1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-03-13 20:28:44 +01:00

[ticket/11362] Add compatibility function phpbb_clean_path() again

The function first depends on the container, but also works without it and
without autoload. The reason for this is, it might be used before that
stuff is set up, like it has been in our common.php

PHPBB3-11362
This commit is contained in:
Joas Schilling 2013-04-18 09:53:02 +02:00
parent ffe9f2a93e
commit ccd4a725da

View File

@ -1046,6 +1046,38 @@ else
}
}
/**
* Eliminates useless . and .. components from specified path.
*
* Deprecated, use filesystem class instead
*
* @param string $path Path to clean
* @return string Cleaned path
*
* @deprecated
*/
function phpbb_clean_path($path)
{
global $phpbb_container;
if ($phpbb_container)
{
$phpbb_filesystem = new phpbb_filesystem();
}
else
{
// The container is not yet loaded, use a new instance
if (!class_exists('phpbb_filesystem'))
{
global $phpbb_root_path, $phpEx;
require($phpbb_root_path . 'includes/filesystem.' . $phpEx);
}
$phpbb_filesystem = new phpbb_filesystem();
}
return $phpbb_filesystem->clean_path($path);
}
// functions used for building option fields
/**