Broken handling of user folder in Grav URI object #2151

This commit is contained in:
Andy Miller
2018-08-21 14:09:25 -06:00
parent 33fffa6a50
commit 2734b2f605
2 changed files with 6 additions and 5 deletions

View File

@@ -1,3 +1,9 @@
# v1.5.1
## mm/dd/2018
1. [](#bugfix)
* Broken handling of user folder in Grav URI object [2151](https://github.com/getgrav/grav/issues/2151)
# v1.5.0
## 08/17/2018

View File

@@ -1336,11 +1336,6 @@ class Uri
$scriptPath = str_replace('\\', '/', $_SERVER['PHP_SELF']);
$rootPath = str_replace(' ', '%20', rtrim(substr($scriptPath, 0, strpos($scriptPath, 'index.php')), '/'));
// check if userdir in the path and workaround PHP bug with PHP_SELF
if (strpos($this->uri, '/~') !== false && strpos($scriptPath, '/~') === false) {
$rootPath = substr($this->uri, 0, strpos($this->uri, '/', 1)) . $rootPath;
}
return $rootPath;
}