diff --git a/framework/Web/THttpRequest.php b/framework/Web/THttpRequest.php index 0c9e16446..987069c8a 100644 --- a/framework/Web/THttpRequest.php +++ b/framework/Web/THttpRequest.php @@ -188,6 +188,10 @@ public function init($config) $this->_pathInfo = $_SERVER['PATH_INFO']; } elseif (strpos($_SERVER['PHP_SELF'], $_SERVER['SCRIPT_NAME']) === 0 && $_SERVER['PHP_SELF'] !== $_SERVER['SCRIPT_NAME']) { $this->_pathInfo = substr($_SERVER['PHP_SELF'], strlen($_SERVER['SCRIPT_NAME'])); + } elseif ($this->_urlFormat === THttpRequestUrlFormat::Path) { + $this->_pathInfo = substr($this->_requestUri, strlen($_SERVER['SCRIPT_NAME'])); + } elseif ($this->_urlFormat === THttpRequestUrlFormat::HiddenPath) { + $this->_pathInfo = substr($this->_requestUri, strlen(dirname($_SERVER['SCRIPT_NAME']))); } else { $this->_pathInfo = ''; } diff --git a/framework/Web/TUrlManager.php b/framework/Web/TUrlManager.php index 7e04fc0b1..b17eebf20 100644 --- a/framework/Web/TUrlManager.php +++ b/framework/Web/TUrlManager.php @@ -124,7 +124,7 @@ public function constructUrl($serviceID, $serviceParam, $getItems, $encodeAmpers public function parseUrl() { $request = $this->getRequest(); - $pathInfo = trim($request->getPathInfo(), '/'); + $pathInfo = urldecode(trim($request->getPathInfo(), '/')); if (($request->getUrlFormat() === THttpRequestUrlFormat::Path || $request->getUrlFormat() === THttpRequestUrlFormat::HiddenPath) && $pathInfo !== '') {