X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=includes%2Ferrors.inc;h=2a1aedd9f9138afdd4ab5bd79c37fa67fbe1191a;hb=11f5f29ce63aaba4e154a5e0521321753d831654;hp=1bf3b3bdeb37235af8f69a5ba7f1719b28cbbffd;hpb=17b390efcf904072b02ec866b2a427490471a260;p=fa-stable.git
diff --git a/includes/errors.inc b/includes/errors.inc
index 1bf3b3bd..2a1aedd9 100644
--- a/includes/errors.inc
+++ b/includes/errors.inc
@@ -79,7 +79,7 @@ function error_handler($errno, $errstr, $file, $line) {
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
+ 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");
@@ -93,46 +93,45 @@ function error_handler($errno, $errstr, $file, $line) {
function fmt_errors($center=false) {
global $messages, $path_to_root, $SysPrefs;
- $msg_class = array(
- E_USER_ERROR => 'err_msg',
- E_USER_WARNING =>'warn_msg',
- E_USER_NOTICE => 'note_msg');
-
- $type = E_USER_NOTICE;
- $content = '';
-// $class = 'no_msg';
- if (count($messages)) {
- foreach($messages as $cnt=>$msg) {
- if ($SysPrefs->go_debug && $msg[0]>E_USER_NOTICE)
- $msg[0] = E_ERROR;
-
- if ($msg[0]>$type) continue;
-
- if ($msg[0]<$type) {
- if ($msg[0] == E_USER_WARNING) {
- $type = E_USER_WARNING; // user warnings
- $content = ''; // clean notices when we have errors
- } else {
- $type = E_USER_ERROR; // php or user errors
- if($type == E_USER_WARNING)
- $content = ''; // clean other messages
+ $msg_class = array(
+ E_USER_ERROR => 'err_msg',
+ E_USER_WARNING =>'warn_msg',
+ E_USER_NOTICE => 'note_msg');
+
+ $type = E_USER_NOTICE;
+ $content = '';
+
+ if (count($messages)) {
+ foreach($messages as $cnt=>$msg) {
+ if ($SysPrefs->go_debug && $msg[0]>E_USER_NOTICE)
+ $msg[0] = E_ERROR;
+
+ if ($msg[0]>$type) continue;
+
+ if ($msg[0]<$type) {
+ if ($msg[0] == E_USER_WARNING) {
+ $type = E_USER_WARNING; // user warnings
+ $content = ''; // clean notices when we have errors
+ } else {
+ $type = E_USER_ERROR; // php or user errors
+ if($type == E_USER_WARNING)
+ $content = ''; // clean other messages
+ }
}
- }
- $str = $msg[1];
- if (!in_array($msg[0], array(E_USER_NOTICE, E_USER_ERROR, E_USER_WARNING)) && $msg[2] != null)
- $str .= ' '._('in file').': '.$msg[2].' '._('at line ').$msg[3];
+ $str = $msg[1];
+ if (!in_array($msg[0], array(E_USER_NOTICE, E_USER_ERROR, E_USER_WARNING)) && $msg[2] != null)
+ $str .= ' '._('in file').': '.$msg[2].' '._('at line ').$msg[3];
- if ($SysPrefs->go_debug>1 && $type!=E_USER_NOTICE && $type!=E_USER_WARNING)
- $str .= '
'.$msg[4];
- $content .= ($cnt ? '