mirror of
https://github.com/php/php-src.git
synced 2025-08-19 08:49:28 +02:00
Fix bug in pushErrorHandling() (fail under very specific circumstances)
This commit is contained in:
parent
8fae36cbd1
commit
02bff6ce0e
1 changed files with 8 additions and 10 deletions
|
@ -40,6 +40,7 @@ if (substr(PHP_OS, 0, 3) == 'WIN') {
|
||||||
$GLOBALS['_PEAR_default_error_mode'] = PEAR_ERROR_RETURN;
|
$GLOBALS['_PEAR_default_error_mode'] = PEAR_ERROR_RETURN;
|
||||||
$GLOBALS['_PEAR_default_error_options'] = E_USER_NOTICE;
|
$GLOBALS['_PEAR_default_error_options'] = E_USER_NOTICE;
|
||||||
$GLOBALS['_PEAR_destructor_object_list'] = array();
|
$GLOBALS['_PEAR_destructor_object_list'] = array();
|
||||||
|
$GLOBALS['_PEAR_error_handler_stack'] = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Base class for other PEAR classes. Provides rudimentary
|
* Base class for other PEAR classes. Provides rudimentary
|
||||||
|
@ -416,7 +417,6 @@ class PEAR
|
||||||
function pushErrorHandling($mode, $options = null)
|
function pushErrorHandling($mode, $options = null)
|
||||||
{
|
{
|
||||||
$stack = &$GLOBALS['_PEAR_error_handler_stack'];
|
$stack = &$GLOBALS['_PEAR_error_handler_stack'];
|
||||||
if (!is_array($stack)) {
|
|
||||||
if (isset($this)) {
|
if (isset($this)) {
|
||||||
$def_mode = &$this->_default_error_mode;
|
$def_mode = &$this->_default_error_mode;
|
||||||
$def_options = &$this->_default_error_options;
|
$def_options = &$this->_default_error_options;
|
||||||
|
@ -424,9 +424,7 @@ class PEAR
|
||||||
$def_mode = &$GLOBALS['_PEAR_default_error_mode'];
|
$def_mode = &$GLOBALS['_PEAR_default_error_mode'];
|
||||||
$def_options = &$GLOBALS['_PEAR_default_error_options'];
|
$def_options = &$GLOBALS['_PEAR_default_error_options'];
|
||||||
}
|
}
|
||||||
$stack = array();
|
|
||||||
$stack[] = array($def_mode, $def_options);
|
$stack[] = array($def_mode, $def_options);
|
||||||
}
|
|
||||||
|
|
||||||
if (isset($this)) {
|
if (isset($this)) {
|
||||||
$this->setErrorHandling($mode, $options);
|
$this->setErrorHandling($mode, $options);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue