X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=includes%2Ferrors.inc;h=cafa86f48cb266eb3c492e92b5dfcac95ebeb722;hb=9e804a1a25b41581b4c0a343879157d732d46db2;hp=8972a9eb4b2fbe0de4fe348528acfd8153ffb2b8;hpb=a5242af68e65661edb7175412444dce536a7f311;p=fa-stable.git diff --git a/includes/errors.inc b/includes/errors.inc index 8972a9eb..cafa86f4 100644 --- a/includes/errors.inc +++ b/includes/errors.inc @@ -12,35 +12,48 @@ $messages = array(); // container for system messages $before_box = ''; // temporary container for output html data before error box -$msg_colors = array( - E_USER_ERROR => array('bg'=>'#ffcccc', 'txt'=>'#dd2200', 'bd'=>'#cc3300'), - E_USER_WARNING => array('bg'=>'#ffff00', 'txt'=>'#ff5500', 'bd'=>'#ff9900'), - E_USER_NOTICE => array('bg'=>'#ccffcc', 'txt'=>'#007700', 'bd'=>'#33cc00')); - //----------------------------------------------------------------------------- // Error handler - collects all php/user messages for // 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; } //------------------------------------------------------------------------------ // Formats system messages before insert them into message