From 6af8c579e0162064785c1b729389bdfd41beba95 Mon Sep 17 00:00:00 2001 From: Tristan Darricau Date: Mon, 24 Aug 2015 23:09:52 +0200 Subject: [PATCH] [ticket/13897] Make dependency to the filesystem optional in error handler PHPBB3-13897 --- phpBB/includes/functions.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index c6d63e13f4..0be3e289e2 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -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);