X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=includes%2Ferrors.inc;h=c5414d60b92b26aca3d27fa8b641a5b7c2fd7421;hb=f8219593c85e1020093b93972386fd477675504f;hp=937270eac3f4c5149371710f5f8ba9cdd48b8458;hpb=8ffddf50ffbe93672c769e2cf0501d0f9125e2a0;p=fa-stable.git
diff --git a/includes/errors.inc b/includes/errors.inc
index 937270ea..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()) {
@@ -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 ? '