[ticket/13897] Make dependency to the filesystem optional in error handler

PHPBB3-13897
This commit is contained in:
Tristan Darricau 2015-08-24 23:09:52 +02:00
parent f6a4843c6d
commit 6af8c579e0

View file

@ -3475,7 +3475,15 @@ function phpbb_filter_root_path($errfile)
if (empty($root_path))
{
$root_path = $phpbb_filesystem->realpath(dirname(__FILE__) . '/../');
if ($phpbb_filesystem)
{
$root_path = $phpbb_filesystem->realpath(dirname(__FILE__) . '/../');
}
else
{
$filesystem = new \phpbb\filesystem\filesystem();
$root_path = $filesystem->realpath(dirname(__FILE__) . '/../');
}
}
return str_replace(array($root_path, '\\'), array('[ROOT]', '/'), $errfile);