[ticket/11215] A few minor optimizations for phpbb_get_web_root_path()

PHPBB3-11215
This commit is contained in:
David King 2012-11-19 19:36:07 -05:00
parent c20f92ba1e
commit 0f522ddf5f

View file

@ -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;
} }