X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=includes%2Ferrors.inc;h=c5414d60b92b26aca3d27fa8b641a5b7c2fd7421;hb=f8219593c85e1020093b93972386fd477675504f;hp=1bf3b3bdeb37235af8f69a5ba7f1719b28cbbffd;hpb=918e4561ac1adc980f79c9c3cdbcf8d250a7fdc0;p=fa-stable.git
diff --git a/includes/errors.inc b/includes/errors.inc
index 1bf3b3bd..c5414d60 100644
--- a/includes/errors.inc
+++ b/includes/errors.inc
@@ -71,7 +71,7 @@ function error_handler($errno, $errstr, $file, $line) {
}
}
- $bt = $SysPrefs->go_debug>1 ? get_backtrace(true, 1) : array();
+ $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()) {
@@ -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 ? '