From 7abdc96499463b223f630cec294933c974f1e8bc Mon Sep 17 00:00:00 2001 From: Clemens Schwaighofer Date: Tue, 24 Apr 2018 10:23:34 +0900 Subject: [PATCH] Fix the Error.Handling.inc method --- www/admin/error_test.php | 3 ++- www/lib/Error.Handling.inc | 8 +++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/www/admin/error_test.php b/www/admin/error_test.php index f9e1aa50..5abf6593 100644 --- a/www/admin/error_test.php +++ b/www/admin/error_test.php @@ -11,7 +11,8 @@ if ($DEBUG_ALL) { // sample config require("config.inc"); -require(LIBS."Error.Handling.inc"); +echo "FILE: ".BASE.LIB."Error.Handling.inc
"; +require(BASE.LIB."Error.Handling.inc"); if ($var) { echo "OUT
"; diff --git a/www/lib/Error.Handling.inc b/www/lib/Error.Handling.inc index 166e14ee..603b4eb0 100644 --- a/www/lib/Error.Handling.inc +++ b/www/lib/Error.Handling.inc @@ -8,7 +8,13 @@ *********************************************************************/ // define the base working directory outside because in the function it might return undefined -DEFINE('CURRENT_WORKING_DIR', getcwd().'/'); +// if we have config set BASE use this +if (defined('BASE')) { + DEFINE('CURRENT_WORKING_DIR', BASE); +} else { + // else we set. We fully assuem that Error.Handling is where it should be, in lib dir + DEFINE('CURRENT_WORKING_DIR', str_replace('lib', '', __DIR__)); +} // METHOD: MyErrorHandler // PARAMS: $type: the error code from PHP