From 7399f29df8f764ff8096620a8f11afae0decc215 Mon Sep 17 00:00:00 2001 From: Tristan Darricau Date: Sat, 5 Jul 2014 14:01:14 +0200 Subject: [PATCH] [ticket/12787] Remove one app.php when it's both in $path and $web_root_path PHPBB3-12787 --- phpBB/phpbb/path_helper.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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;