From 2734b2f605807c6174cf149fca1daa8eb914a159 Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Tue, 21 Aug 2018 14:09:25 -0600 Subject: [PATCH] Broken handling of user folder in Grav URI object #2151 --- CHANGELOG.md | 6 ++++++ system/src/Grav/Common/Uri.php | 5 ----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 16feced8d..3b5963dad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/system/src/Grav/Common/Uri.php b/system/src/Grav/Common/Uri.php index 4bb6bc7b1..35e9d3b3f 100644 --- a/system/src/Grav/Common/Uri.php +++ b/system/src/Grav/Common/Uri.php @@ -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; }