summaryrefslogtreecommitdiffstats
path: root/system/core/Common.php
diff options
context:
space:
mode:
authorFrancesco Negri <francesconegri@gmail.com>2012-08-04 13:16:50 +0200
committerFrancesco Negri <francesconegri@gmail.com>2012-08-04 13:16:50 +0200
commit0e0c37bc3b8e46d9ecc89fd5591e6b258ebd8b74 (patch)
treea166f8bfd7e16376120898f60e74889d29bb13d4 /system/core/Common.php
parent6c94c2dcfb6557947c9ac67e419b2856fd80e01d (diff)
Logging should obey error_reporting() setting
If the php error level is not included in the current error_reporting() setting, we should not log it. Also, the log_threshold check is redundant, it's already taken care of by the write_log() method.
Diffstat (limited to 'system/core/Common.php')
-rw-r--r--system/core/Common.php19
1 files changed, 9 insertions, 10 deletions
diff --git a/system/core/Common.php b/system/core/Common.php
index 57374b07d..cb99d0505 100644
--- a/system/core/Common.php
+++ b/system/core/Common.php
@@ -524,21 +524,20 @@ if ( ! function_exists('_exception_handler'))
{
$_error =& load_class('Exceptions', 'core');
- // Should we display the error? We'll get the current error_reporting
+ // Should we ignore the error? We'll get the current error_reporting
// level and add its bits with the severity bits to find out.
- // And respect display_errors
- if (($severity & error_reporting()) === $severity && (bool) ini_get('display_errors') === TRUE)
+ if (($severity & error_reporting()) !== $severity)
+ {
+ return;
+ }
+
+ // Should we display the error?
+ if ((bool) ini_get('display_errors') === TRUE)
{
$_error->show_php_error($severity, $message, $filepath, $line);
}
- // Should we log the error? No? We're done...
- if (config_item('log_threshold') === 0)
- {
- return;
- }
-
- $_error->log_exception($severity, $message, $filepath, $line);
+ $_error->log_exception($severity, $message, $filepath, $line);
}
}