mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Fixing CakeLog::handleError() being called too often.
Adding a PHP5 conditional, so custom error handlers are not called for errors not in the configured masking. Fixes #1735
This commit is contained in:
parent
5fd19266ba
commit
b64b1219c4
2 changed files with 10 additions and 5 deletions
|
@ -288,5 +288,9 @@ class CakeLog {
|
|||
|
||||
if (!defined('DISABLE_DEFAULT_ERROR_HANDLING')) {
|
||||
$cakeLog =& CakeLog::getInstance();
|
||||
set_error_handler(array($cakeLog, 'handleError'));
|
||||
if (PHP5) {
|
||||
set_error_handler(array($cakeLog, 'handleError'), error_reporting());
|
||||
} else {
|
||||
set_error_handler(array($cakeLog, 'handleError'));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -123,14 +123,15 @@ class Configure extends Object {
|
|||
}
|
||||
|
||||
if (isset($_this->log) && $_this->log) {
|
||||
if (!class_exists('CakeLog')) {
|
||||
require LIBS . 'cake_log.php';
|
||||
}
|
||||
if (is_integer($_this->log) && !$_this->debug) {
|
||||
$reporting = $_this->log;
|
||||
} else {
|
||||
$reporting = E_ALL & ~E_DEPRECATED;
|
||||
}
|
||||
error_reporting($reporting);
|
||||
if (!class_exists('CakeLog')) {
|
||||
require LIBS . 'cake_log.php';
|
||||
}
|
||||
}
|
||||
error_reporting($reporting);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue