diff --git a/src/Symfony/Bundle/FrameworkBundle/HttpKernel.php b/src/Symfony/Bundle/FrameworkBundle/HttpKernel.php index 8a46326c82adb..2f0ca70c88a03 100644 --- a/src/Symfony/Bundle/FrameworkBundle/HttpKernel.php +++ b/src/Symfony/Bundle/FrameworkBundle/HttpKernel.php @@ -124,7 +124,7 @@ public function render($controller, array $options = array()) // controller or URI? if (0 === strpos($controller, '/')) { - $subRequest = Request::create($controller, 'get', array(), $request->cookies->all(), array(), $request->server->all()); + $subRequest = Request::create($request->getUriForPath($controller), 'get', array(), $request->cookies->all(), array(), $request->server->all()); $subRequest->setSession($request->getSession()); } else { $options['attributes']['_controller'] = $controller; diff --git a/src/Symfony/Component/Security/Http/HttpUtils.php b/src/Symfony/Component/Security/Http/HttpUtils.php index a293538d22e09..a26b1bd0a4cdd 100644 --- a/src/Symfony/Component/Security/Http/HttpUtils.php +++ b/src/Symfony/Component/Security/Http/HttpUtils.php @@ -71,6 +71,9 @@ public function createRequest(Request $request, $path) $this->resetLocale($request); $path = $this->generateUrl($path, true); } + if (0 !== strpos($path, 'http')) { + $path = $request->getUriForPath($path); + } $newRequest = Request::create($path, 'get', array(), $request->cookies->all(), array(), $request->server->all()); if ($session = $request->getSession()) {