diff options
author | Nathan Guse <nathaniel.guse@gmail.com> | 2013-09-09 11:19:52 -0700 |
---|---|---|
committer | Nathan Guse <nathaniel.guse@gmail.com> | 2013-09-09 11:19:52 -0700 |
commit | 2146d0c36b1bec9dffba49e9727f8b493a0fb0f2 (patch) | |
tree | 32290b7bf4001a65105f7fb740fd77b6a132fcce | |
parent | dd86e8d0ae0179cf50076cdb1a8020266b6432a5 (diff) | |
parent | 07632d46fc730c9b487e7a550ad94d08cb72e27d (diff) | |
download | forums-2146d0c36b1bec9dffba49e9727f8b493a0fb0f2.tar forums-2146d0c36b1bec9dffba49e9727f8b493a0fb0f2.tar.gz forums-2146d0c36b1bec9dffba49e9727f8b493a0fb0f2.tar.bz2 forums-2146d0c36b1bec9dffba49e9727f8b493a0fb0f2.tar.xz forums-2146d0c36b1bec9dffba49e9727f8b493a0fb0f2.zip |
Merge pull request #1703 from cyberalien/ticket/develop/11832
Fix path detection
-rw-r--r-- | phpBB/includes/functions.php | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 4d2d704a43..7cc3e11129 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -5733,6 +5733,8 @@ function phpbb_create_symfony_request(phpbb_request $request) */ function phpbb_get_web_root_path(Request $symfony_request, $phpbb_root_path = '') { + global $phpbb_container; + static $path; if (null !== $path) { @@ -5746,7 +5748,11 @@ function phpbb_get_web_root_path(Request $symfony_request, $phpbb_root_path = '' return $path; } - $corrections = substr_count($path_info, '/'); + $filesystem = $phpbb_container->get('filesystem'); + $path_info = $filesystem->clean_path($path_info); + + // Do not count / at start of path + $corrections = substr_count(substr($path_info, 1), '/'); // When URL Rewriting is enabled, app.php is optional. We have to // correct for it not being there |