From a8334c9858a3124d905ff67ff1865274051883a6 Mon Sep 17 00:00:00 2001 From: Janusz Dobrowolski Date: Tue, 7 Dec 2010 16:04:34 +0000 Subject: [PATCH] Additional fix to error handling. --- CHANGELOG.txt | 1 + includes/errors.inc | 9 +++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index b4f0cf1e..abe22c68 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -37,6 +37,7 @@ $ /includes/hooks.inc $ /admin/inst_module.php /includes/main.inc /includes/session.inc + /includes/errors.inc 03-Dec-2010 Janusz Dobrowolski # Fixed company prefs refresh after upgrade/restore diff --git a/includes/errors.inc b/includes/errors.inc index c584d175..bcb3cd3f 100644 --- a/includes/errors.inc +++ b/includes/errors.inc @@ -31,10 +31,11 @@ function error_handler($errno, $errstr, $file, $line) { // error_reporting==0 when messages are set off with @ if ($errno & error_reporting()) $messages[] = array($errno, $errstr, $file, $line); - else if($errno&~E_NOTICE)// log all not displayed messages - error_log(user_company() . ':' . $_SESSION["wa_current_user"]->loginname.':' - . basename($file) .":$line:" . ( $SysPrefs->db_ok ? '':'[before upgrade]') - . " $errstr"); + else if($errno&~E_NOTICE) { // log all not displayed messages + $user = @$_SESSION["wa_current_user"]->loginname; + $context = isset($SysPrefs) && !$SysPrefs->db_ok ? '[before upgrade]' : ''; + error_log(user_company() . ":$user:". basename($file) .":$line:$context $errstr"); + } return true; } -- 2.30.2