X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=includes%2Ferrors.inc;h=9e0dba2e87fc99edf3694e96528e6096e74c31b3;hb=3613e32ad573d5faccb974a421702bdd87583878;hp=1a39f1637ce3bffef74fbc61c28e42582ad843f8;hpb=89cb648e9d031fa624e7814f89e90ccba2042124;p=fa-stable.git diff --git a/includes/errors.inc b/includes/errors.inc index 1a39f163..9e0dba2e 100644 --- a/includes/errors.inc +++ b/includes/errors.inc @@ -17,12 +17,25 @@ $before_box = ''; // temporary container for output html data before error box // display in message box. function error_handler($errno, $errstr, $file, $line) { - global $messages; + global $messages, $go_debug, $SysPrefs; - // error_reporting==0 when messages are set off with @ - if ($errno & error_reporting()) { - $messages[] = array($errno, $errstr, $file, $line); + // skip well known warnings we don't care about. + // Please use restrainedly to not risk loss of important messages + $excluded_warnings = array('html_entity_decode', 'htmlspecialchars'); + foreach($excluded_warnings as $ref) { + if (strpos($errstr, $ref) !== false) { + return true; + } } + + // 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"); + return true; } //------------------------------------------------------------------------------ @@ -38,7 +51,7 @@ function fmt_errors($center=false) { $type = E_USER_NOTICE; $content = ''; - $class = 'no_msg'; +// $class = 'no_msg'; if (count($messages)) { foreach($messages as $cnt=>$msg) { if ($msg[0]>$type) continue; @@ -59,11 +72,10 @@ function fmt_errors($center=false) { $content .= ($cnt ? '