Added strict warnings display as errors in debug mode.
authorJanusz Dobrowolski <janusz@frontaccouting.eu>
Wed, 11 May 2011 13:03:18 +0000 (15:03 +0200)
committerJanusz Dobrowolski <janusz@frontaccouting.eu>
Wed, 11 May 2011 13:03:18 +0000 (15:03 +0200)
includes/errors.inc

index 9687b6ddef3b4c21f75cda759e79295d14b10ca9..459b306211722122f9dd0b46225051e6645ccc77 100644 (file)
@@ -102,6 +102,9 @@ function fmt_errors($center=false) {
 //  $class = 'no_msg';
   if (count($messages)) {
        foreach($messages as $cnt=>$msg) {
+               if ($go_debug && $msg[0]>E_USER_NOTICE)
+                       $msg[0] = E_ERROR;
+
                if ($msg[0]>$type) continue;
 
                if ($msg[0]<$type) { 
@@ -114,9 +117,11 @@ function fmt_errors($center=false) {
                                        $content = '';                  // clean other messages
                        }
                }
+               
            $str = $msg[1];
-               if ($msg[0] < E_USER_ERROR && $msg[2] != null)
+               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 ($go_debug>1 && $type!=E_USER_NOTICE && $type!=E_USER_WARNING)
                  $str .= '<br>'.$msg[4];
                $content .= ($cnt ? '<hr>' : '').$str;