- // 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) { // 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");
+ }