Menu ▾ ▴

#20 ErrorHandler reports all errors

open
nobody
None
5
2005-09-27
2005-09-27
Living Dead
No

When integrating JPSpan with Smarty, I get errors
like "Undefined index" in templates, because
JPSpan_ErrorHandler reports all errors (without
checking the error_reporting status first).

I fixed that by adding the following code in the beginning
of JPSpan_ErrorHandler():

function JPSpan_ErrorHandler($level, $message, $file,
$line) {

// check whether error_reporting has been turned off
for this level
if (! (error_reporting() & $level)) {
return true;
}

Discussion


Log in to post a comment.