Browse Source

fix get_class() case-sensitive incompatibility in PHP5

PEAR_1_4DEV
Greg Beaver 23 years ago
parent
commit
7dc2bf3605
  1. 12
      pear/PEAR.php

12
pear/PEAR.php

@ -232,8 +232,8 @@ class PEAR
*/ */
function isError($data, $code = null) function isError($data, $code = null)
{ {
if (is_object($data) && (get_class($data) == 'pear_error' ||
is_subclass_of($data, 'pear_error'))) {
if (is_object($data) && (strtolower(get_class($data)) == 'pear_error' ||
is_subclass_of($data, 'PEAR_Error'))) {
if (is_null($code)) { if (is_null($code)) {
return true; return true;
} elseif (is_string($code)) { } elseif (is_string($code)) {
@ -290,7 +290,7 @@ class PEAR
function setErrorHandling($mode = null, $options = null) function setErrorHandling($mode = null, $options = null)
{ {
if (isset($this) && if (isset($this) &&
(get_class($this) == 'pear' || is_subclass_of($this, 'pear'))) {
(strtolower(get_class($this)) == 'pear' || is_subclass_of($this, 'PEAR'))) {
$setmode = &$this->_default_error_mode; $setmode = &$this->_default_error_mode;
$setoptions = &$this->_default_error_options; $setoptions = &$this->_default_error_options;
} else { } else {
@ -568,7 +568,7 @@ class PEAR
{ {
$stack = &$GLOBALS['_PEAR_error_handler_stack']; $stack = &$GLOBALS['_PEAR_error_handler_stack'];
if (isset($this) && if (isset($this) &&
(get_class($this) == 'pear' || is_subclass_of($this, 'pear'))) {
(strtolower(get_class($this)) == 'pear' || is_subclass_of($this, 'PEAR'))) {
$def_mode = &$this->_default_error_mode; $def_mode = &$this->_default_error_mode;
$def_options = &$this->_default_error_options; $def_options = &$this->_default_error_options;
} else { } else {
@ -578,7 +578,7 @@ class PEAR
$stack[] = array($def_mode, $def_options); $stack[] = array($def_mode, $def_options);
if (isset($this) && if (isset($this) &&
(get_class($this) == 'pear' || is_subclass_of($this, 'pear'))) {
(strtolower(get_class($this)) == 'pear' || is_subclass_of($this, 'PEAR'))) {
$this->setErrorHandling($mode, $options); $this->setErrorHandling($mode, $options);
} else { } else {
PEAR::setErrorHandling($mode, $options); PEAR::setErrorHandling($mode, $options);
@ -604,7 +604,7 @@ class PEAR
list($mode, $options) = $stack[sizeof($stack) - 1]; list($mode, $options) = $stack[sizeof($stack) - 1];
array_pop($stack); array_pop($stack);
if (isset($this) && if (isset($this) &&
(get_class($this) == 'pear' || is_subclass_of($this, 'pear'))) {
(strtolower(get_class($this)) == 'pear' || is_subclass_of($this, 'PEAR'))) {
$this->setErrorHandling($mode, $options); $this->setErrorHandling($mode, $options);
} else { } else {
PEAR::setErrorHandling($mode, $options); PEAR::setErrorHandling($mode, $options);

Loading…
Cancel
Save