X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=includes%2Ferrors.inc;h=a54abba810f3adf87d950d29f6c763dd6a5f81da;hb=ab24fcc549bb72e495fb85e5dcad41bc14d85b7d;hp=53587df6ed081b1489e162d77898d474e48f3ed6;hpb=19ddc3939071044c8e94b628f1d6a039f50cc493;p=fa-stable.git diff --git a/includes/errors.inc b/includes/errors.inc index 53587df6..a54abba8 100644 --- a/includes/errors.inc +++ b/includes/errors.inc @@ -57,7 +57,7 @@ function get_backtrace($html = false, $skip=0) // display in message box. function error_handler($errno, $errstr, $file, $line) { - global $messages, $SysPrefs; + global $messages, $SysPrefs, $cur_error_level; // skip well known warnings we don't care about. // Please use restrainedly to not risk loss of important messages @@ -74,16 +74,18 @@ function error_handler($errno, $errstr, $file, $line) { $bt = isset($SysPrefs) && $SysPrefs->go_debug>1 ? get_backtrace(true, 1) : array(); - // error_reporting==0 when messages are set off with @ - if ($errno & error_reporting()) { - // suppress duplicated errors - if (!in_array(array($errno, $errstr, $file, $line, @$bt), $messages)) - $messages[] = array($errno, $errstr, $file, $line, @$bt); - } - else if ($errno&~E_NOTICE && $errstr != '') { // 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"); + // error_reporting!=cur_error_level when messages are set off with @ + if ($cur_error_level == error_reporting()) { + if ($errno & $cur_error_level) { + // suppress duplicated errors + if (!in_array(array($errno, $errstr, $file, $line, @$bt), $messages)) + $messages[] = array($errno, $errstr, $file, $line, @$bt); + } + else if ($errno&~E_NOTICE && $errstr != '') { // 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;