1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-05 00:07:44 +02:00

[ticket/10848] Redirect from adm to installer correctly.

PHPBB3-10848
This commit is contained in:
Oleg Pudeyev
2012-10-17 15:03:06 -04:00
parent f0544c884f
commit c630480ca1
3 changed files with 79 additions and 1 deletions

View File

@@ -1176,6 +1176,36 @@ else
}
}
/**
* Eliminates useless . and .. components from specified path.
*
* @param string $path Path to clean
* @return string Cleaned path
*/
function clean_path($path)
{
$exploded = explode('/', $path);
$filtered = array();
foreach ($exploded as $part)
{
if ($part === '.' && !empty($filtered))
{
continue;
}
if ($part === '..' && !empty($filtered) && $filtered[sizeof($filtered) - 1] !== '..')
{
array_pop($filtered);
}
else
{
$filtered[] = $part;
}
}
$path = implode('/', $filtered);
return $path;
}
if (!function_exists('htmlspecialchars_decode'))
{
/**