Skip to content
Browse files

Presenter: fixed reference URI passing to IRouter in createRequest()

  • Loading branch information...
1 parent 14e07b1 commit 6f70969957a722016b3bbc0a4ae24b3654058d08 @dg dg committed Nov 22, 2010
Showing with 5 additions and 4 deletions.
  1. +5 −4 Nette/Application/Presenter.php
View
9 Nette/Application/Presenter.php
@@ -733,11 +733,12 @@ public function lastModified($lastModified, $etag = NULL, $expire = NULL)
// note: createRequest supposes that saveState(), run() & tryCall() behaviour is final
// cached services for better performance
- static $presenterLoader, $router, $httpRequest;
+ static $presenterLoader, $router, $refUri;
if ($presenterLoader === NULL) {
$presenterLoader = $this->getApplication()->getPresenterLoader();
$router = $this->getApplication()->getRouter();
- $httpRequest = $this->getHttpRequest();
+ $refUri = new Nette\Web\Uri($this->getHttpRequest()->getUri());
+ $refUri->setPath($this->getHttpRequest()->getUri()->getScriptPath());
}
$this->lastCreatedRequest = $this->lastCreatedRequestFlag = NULL;
@@ -923,7 +924,7 @@ public function lastModified($lastModified, $etag = NULL, $expire = NULL)
if ($mode === 'forward') return;
// CONSTRUCT URL
- $uri = $router->constructUrl($this->lastCreatedRequest, $httpRequest->getUri());
+ $uri = $router->constructUrl($this->lastCreatedRequest, $refUri);
if ($uri === NULL) {
unset($args[self::ACTION_KEY]);
$params = urldecode(http_build_query($args, NULL, ', '));
@@ -932,7 +933,7 @@ public function lastModified($lastModified, $etag = NULL, $expire = NULL)
// make URL relative if possible
if ($mode === 'link' && $scheme === FALSE && !$this->absoluteUrls) {
- $hostUri = $httpRequest->getUri()->getHostUri();
+ $hostUri = $refUri->getHostUri();
if (strncmp($uri, $hostUri, strlen($hostUri)) === 0) {
$uri = substr($uri, strlen($hostUri));
}

0 comments on commit 6f70969

Please sign in to comment.
Something went wrong with that request. Please try again.