Commit 7b8fa02f authored by Nigel McNie's avatar Nigel McNie Committed by Nigel McNie
Browse files

Ignore notices from smarty templates. Only trim the absolute path from the

script name when logging if the script is actually in the docroot.
parent 20ecaa1c
......@@ -95,7 +95,11 @@ function log_message ($message, $loglevel, $escape, $file=null, $line=null) {
// Make a prefix for each line, if we are logging a normal debug/info/warn message
if ($loglevel != LOG_LEVEL_ENVIRON && function_exists('get_config')) {
$prefix = '(' . substr($filename, strlen(get_config('docroot'))) . ':' . $linenum . ') ';
$docroot = get_config('docroot');
$prefixfilename = (substr($filename, 0, strlen($docroot)) == $docroot)
? substr($filename, strlen($docroot))
: $filename;
$prefix = '(' . $prefixfilename . ':' . $linenum . ') ';
}
else {
$prefix = '';
......@@ -240,6 +244,12 @@ function error ($code, $message, $file, $line, $vars) {
return;
}
// Ignore errors from smarty templates, which happen all too often
$compiledir = get_config('dataroot') . 'smarty/compile';
if (E_NOTICE == $code && substr($file, 0, strlen($compiledir)) == $compiledir) {
return;
}
// Fix up the message, which is in HTML form
$message = strip_tags($message);
$message = htmlspecialchars_decode($message);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment