mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-12 22:38:52 +00:00
[ticket/11215] A few minor optimizations for phpbb_get_web_root_path()
PHPBB3-11215
This commit is contained in:
parent
c20f92ba1e
commit
0f522ddf5f
1 changed files with 4 additions and 8 deletions
|
@ -5745,16 +5745,12 @@ function phpbb_get_web_root_path(Request $symfony_request)
|
||||||
$path_info = $symfony_request->getPathInfo();
|
$path_info = $symfony_request->getPathInfo();
|
||||||
if ($path_info == '/')
|
if ($path_info == '/')
|
||||||
{
|
{
|
||||||
return '';
|
$path = '';
|
||||||
|
return $path;
|
||||||
}
|
}
|
||||||
|
|
||||||
$corrections = substr_count($symfony_request->getPathInfo(), '/');
|
$corrections = substr_count($path_info, '/');
|
||||||
|
$path = str_repeat('../', $corrections);
|
||||||
$path = '';
|
|
||||||
for ($i = 0; $i < $corrections; $i++)
|
|
||||||
{
|
|
||||||
$path .= '../';
|
|
||||||
}
|
|
||||||
|
|
||||||
return $path;
|
return $path;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue