aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes')
-rw-r--r--phpBB/includes/functions.php11
1 files changed, 10 insertions, 1 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index 213f178694..331eaf742e 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -5743,7 +5743,16 @@ function phpbb_get_web_root_path(Request $symfony_request)
}
$path_info = $symfony_request->getPathInfo();
- if ($path_info == '/')
+
+ // When no path is given (i.e. REQUEST_URI = "./app.php") path info from
+ // the Symfony Request object is "/". However, that is the same as when
+ // the REQUEST_URI is "./app.php/". So we want to correct the path when
+ // we have a trailing slash in the REQUEST_URI, but not when we don't.
+ $request_uri = $symfony_request->server->get('REQUEST_URI');
+ $trailing_slash = substr($request_uri, -1) === '/';
+
+ // If pathinfo is / and we do not have a trailing slash in the REQUEST_URI
+ if (!$trailing_slash && '/' === $path_info)
{
$path = '';
return $path;