mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-25 02:51:35 +02:00
[ticket/11215] A few minor optimizations for phpbb_get_web_root_path()
PHPBB3-11215
This commit is contained in:
@@ -5745,16 +5745,12 @@ function phpbb_get_web_root_path(Request $symfony_request)
|
||||
$path_info = $symfony_request->getPathInfo();
|
||||
if ($path_info == '/')
|
||||
{
|
||||
return '';
|
||||
$path = '';
|
||||
return $path;
|
||||
}
|
||||
|
||||
$corrections = substr_count($symfony_request->getPathInfo(), '/');
|
||||
|
||||
$path = '';
|
||||
for ($i = 0; $i < $corrections; $i++)
|
||||
{
|
||||
$path .= '../';
|
||||
}
|
||||
$corrections = substr_count($path_info, '/');
|
||||
$path = str_repeat('../', $corrections);
|
||||
|
||||
return $path;
|
||||
}
|
||||
|
Reference in New Issue
Block a user