diff options
author | Paul Arthur <paul.arthur@flowerysong.com> | 2013-01-29 14:32:43 -0500 |
---|---|---|
committer | Paul Arthur <paul.arthur@flowerysong.com> | 2013-01-29 14:32:43 -0500 |
commit | c4f149b215775c3cfd76af97cd15d65f03dd75f7 (patch) | |
tree | 00dd9dd9b9d7c4e192d4d2ede748e7ed48014f25 | |
parent | 7c43b63109f35e58ab5b1804a532b140147549d8 (diff) | |
download | ampache-c4f149b215775c3cfd76af97cd15d65f03dd75f7.tar.gz ampache-c4f149b215775c3cfd76af97cd15d65f03dd75f7.tar.bz2 ampache-c4f149b215775c3cfd76af97cd15d65f03dd75f7.zip |
Make our error handler respect error_reporting()
Kind of. But not really. Because I'm contrary like that.
-rw-r--r-- | lib/log.lib.php | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/log.lib.php b/lib/log.lib.php index 6f9df914..dfd4d81d 100644 --- a/lib/log.lib.php +++ b/lib/log.lib.php @@ -49,12 +49,11 @@ function log_event($username, $event_name, $event_description, $log_name) { /* * ampache_error_handler + * * An error handler for ampache that traps as many errors as it can and logs * them. -*/ + */ function ampache_error_handler($errno, $errstr, $errfile, $errline) { - - /* Default level of 1 */ $level = 1; switch ($errno) { @@ -108,15 +107,19 @@ function ampache_error_handler($errno, $errstr, $errfile, $errline) { } } - if (strpos($errstr,"date.timezone") !== false) { + if (error_reporting() == 0) { + // Ignored, probably via @. But not really, so use the super-sekrit level + $level = 7; + } + + if (strpos($errstr, 'date.timezone') !== false) { $error_name = 'Warning'; $errstr = 'You have not set a valid timezone (date.timezone) in your php.ini file. This may cause display issues with dates. This warning is non-critical and not caused by Ampache.'; } $log_line = "[$error_name] $errstr in file $errfile($errline)"; debug_event('PHP', $log_line, $level, '', 'ampache'); - -} // ampache_error_handler +} /** * debug_event |