summaryrefslogtreecommitdiffstats
path: root/Http
diff options
context:
space:
mode:
authorFabien Potencier <fabien.potencier@gmail.com>2013-03-20 15:03:03 +0100
committerFabien Potencier <fabien.potencier@gmail.com>2013-03-20 15:03:03 +0100
commitab9e18a00d9da04e7ff5f204ed88bc8307e2bec9 (patch)
tree1368c15cc2c6da707bf19df3adcdc143fb3d8299 /Http
parent47037a7958cd3968161fc08710bc30cad1eba115 (diff)
parentd6e78258d9049f137549718524585e8822b06d95 (diff)
downloadsymfony-security-ab9e18a00d9da04e7ff5f204ed88bc8307e2bec9.zip
symfony-security-ab9e18a00d9da04e7ff5f204ed88bc8307e2bec9.tar.gz
symfony-security-ab9e18a00d9da04e7ff5f204ed88bc8307e2bec9.tar.bz2
Merge branch '2.2'
* 2.2: (70 commits) change wrapped exception message to be more usefull updated VERSION for 2.0.23 update CONTRIBUTORS for 2.0.23 updated CHANGELOG for 2.0.23 [Form] fixed failing test [DomCrawler] added support for query string with slash Fixed invalid file path for hiddeninput.exe on Windows. fix xsd definition for strict-requirements [WebProfilerBundle] Fixed the toolbar styles to apply them in IE8 [ClassLoader] fixed heredocs handling fixed handling of heredocs Add a public modifier to an interface method removing xdebug extension [HttpRequest] fixes Request::getLanguages() bug [HttpCache] added a test (cached content should be kept after purging) [DoctrineBridge] Fixed non-utf-8 recognition [Security] fixed HttpUtils class tests replaced new occurences of 'Request::create()' with '::create()' changed sub-requests creation to '::create()' fixed merge issue ... Conflicts: src/Symfony/Bundle/FrameworkBundle/Command/TranslationUpdateCommand.php src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/toolbar.html.twig src/Symfony/Component/DomCrawler/Link.php src/Symfony/Component/Translation/Translator.php
Diffstat (limited to 'Http')
-rw-r--r--Http/HttpUtils.php14
1 files changed, 12 insertions, 2 deletions
diff --git a/Http/HttpUtils.php b/Http/HttpUtils.php
index eb7894c..0453520 100644
--- a/Http/HttpUtils.php
+++ b/Http/HttpUtils.php
@@ -70,7 +70,7 @@ class HttpUtils
*/
public function createRequest(Request $request, $path)
{
- $newRequest = Request::create($this->generateUri($request, $path), 'get', array(), $request->cookies->all(), array(), $request->server->all());
+ $newRequest = $request::create($this->generateUri($request, $path), 'get', array(), $request->cookies->all(), array(), $request->server->all());
if ($request->hasSession()) {
$newRequest->setSession($request->getSession());
}
@@ -140,6 +140,16 @@ class HttpUtils
throw new \LogicException('You must provide a UrlGeneratorInterface instance to be able to use routes.');
}
- return $this->urlGenerator->generate($path, array(), UrlGeneratorInterface::ABSOLUTE_URL);
+ $url = $this->urlGenerator->generate($path, $request->attributes->all(), UrlGeneratorInterface::ABSOLUTE_URL);
+
+ // unnecessary query string parameters must be removed from url
+ // (ie. query parameters that are presents in $attributes)
+ // fortunately, they all are, so we have to remove entire query string
+ $position = strpos($url, '?');
+ if (false !== $position) {
+ $url = substr($url, 0, $position);
+ }
+
+ return $url;
}
}