mirror of
https://github.com/getgrav/grav.git
synced 2026-07-12 04:22:16 +02:00
Broken handling of user folder in Grav URI object #2151
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user