From 199521806c444e7cc04e0b56be5d7f684d40d5a0 Mon Sep 17 00:00:00 2001 From: Janusz Dobrowolski Date: Wed, 11 May 2011 15:03:18 +0200 Subject: [PATCH] Added strict warnings display as errors in debug mode. --- includes/errors.inc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/includes/errors.inc b/includes/errors.inc index 9687b6d..459b306 100644 --- a/includes/errors.inc +++ b/includes/errors.inc @@ -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 .= '
'.$msg[4]; $content .= ($cnt ? '
' : '').$str; -- 2.30.2