From: Janusz Dobrowolski Date: Tue, 7 Dec 2010 16:04:34 +0000 (+0000) Subject: Additional fix to error handling. X-Git-Tag: v2.4.2~19^2~422 X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=commitdiff_plain;h=a8334c9858a3124d905ff67ff1865274051883a6;p=fa-stable.git Additional fix to error handling. --- 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; }