diff options
author | Tristan Darricau <github@nicofuma.fr> | 2014-07-05 14:01:14 +0200 |
---|---|---|
committer | Tristan Darricau <github@nicofuma.fr> | 2014-07-05 14:01:14 +0200 |
commit | 7399f29df8f764ff8096620a8f11afae0decc215 (patch) | |
tree | f082659034214b60e9a57971747f204b8a54690f | |
parent | bc47e719b1c10ba43b7da0062f8236a8d137a159 (diff) | |
download | forums-7399f29df8f764ff8096620a8f11afae0decc215.tar forums-7399f29df8f764ff8096620a8f11afae0decc215.tar.gz forums-7399f29df8f764ff8096620a8f11afae0decc215.tar.bz2 forums-7399f29df8f764ff8096620a8f11afae0decc215.tar.xz forums-7399f29df8f764ff8096620a8f11afae0decc215.zip |
[ticket/12787] Remove one app.php when it's both in $path and $web_root_path
PHPBB3-12787
-rw-r--r-- | phpBB/phpbb/path_helper.php | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/phpBB/phpbb/path_helper.php b/phpBB/phpbb/path_helper.php index 8b2c31b478..a8592eac6c 100644 --- a/phpBB/phpbb/path_helper.php +++ b/phpBB/phpbb/path_helper.php @@ -104,7 +104,13 @@ class path_helper { $path = substr($path, strlen($this->phpbb_root_path)); - return $this->filesystem->clean_path($this->get_web_root_path() . $path); + $web_root_path = $this->get_web_root_path(); + if (substr($web_root_path, -8) === 'app.php/' && substr($path, 0, 7) === 'app.php') + { + $path = substr($path, 8); + } + + return $this->filesystem->clean_path($web_root_path . $path); } return $path; |