diff options
author | Tomas V.V.Cox <cox@php.net> | 2002-04-06 15:12:04 +0000 |
---|---|---|
committer | Tomas V.V.Cox <cox@php.net> | 2002-04-06 15:12:04 +0000 |
commit | 02bff6ce0efdead92fa68dd786b2d322d5d1589f (patch) | |
tree | 9cf4b041be4f1a5dbe98baba3b85460a9b10cf94 /pear/PEAR.php | |
parent | 8fae36cbd1976b26e405e3954b6cd04c3f220e4d (diff) | |
download | php-git-02bff6ce0efdead92fa68dd786b2d322d5d1589f.tar.gz |
Fix bug in pushErrorHandling() (fail under very specific circumstances)
Diffstat (limited to 'pear/PEAR.php')
-rw-r--r-- | pear/PEAR.php | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/pear/PEAR.php b/pear/PEAR.php index 7c5198b6b1..98804a1704 100644 --- a/pear/PEAR.php +++ b/pear/PEAR.php @@ -40,6 +40,7 @@ if (substr(PHP_OS, 0, 3) == 'WIN') { $GLOBALS['_PEAR_default_error_mode'] = PEAR_ERROR_RETURN; $GLOBALS['_PEAR_default_error_options'] = E_USER_NOTICE; $GLOBALS['_PEAR_destructor_object_list'] = array(); +$GLOBALS['_PEAR_error_handler_stack'] = array(); /** * Base class for other PEAR classes. Provides rudimentary @@ -416,17 +417,14 @@ class PEAR function pushErrorHandling($mode, $options = null) { $stack = &$GLOBALS['_PEAR_error_handler_stack']; - if (!is_array($stack)) { - if (isset($this)) { - $def_mode = &$this->_default_error_mode; - $def_options = &$this->_default_error_options; - } else { - $def_mode = &$GLOBALS['_PEAR_default_error_mode']; - $def_options = &$GLOBALS['_PEAR_default_error_options']; - } - $stack = array(); - $stack[] = array($def_mode, $def_options); + if (isset($this)) { + $def_mode = &$this->_default_error_mode; + $def_options = &$this->_default_error_options; + } else { + $def_mode = &$GLOBALS['_PEAR_default_error_mode']; + $def_options = &$GLOBALS['_PEAR_default_error_options']; } + $stack[] = array($def_mode, $def_options); if (isset($this)) { $this->setErrorHandling($mode, $options); |