From 40b58730620aab36899d41dba3e5e0a1bbea941e Mon Sep 17 00:00:00 2001 From: rurban Date: Sun, 20 Jun 2004 15:30:06 +0000 Subject: [PATCH] get_class case-sensitivity issues git-svn-id: svn://svn.code.sf.net/p/phpwiki/code/trunk@3746 96ab9672-09ca-45d6-a79d-3d69d39ca109 --- lib/BlockParser.php | 11 +++++++---- lib/ErrorManager.php | 7 +++++-- lib/WikiDB/adodb/adodb-pear.inc.php | 4 ++-- lib/WikiUserNew.php | 13 ++++++++----- lib/XmlElement.php | 9 ++++++--- lib/nusoap/nusoap.php | 13 +++++++------ lib/pear/Config.php | 4 ++-- lib/pear/DB.php | 4 ++-- lib/pear/DB/common.php | 4 ++-- lib/pear/PEAR.php | 6 +++--- 10 files changed, 44 insertions(+), 31 deletions(-) diff --git a/lib/BlockParser.php b/lib/BlockParser.php index c5dab8a12..9e5e8ecf1 100644 --- a/lib/BlockParser.php +++ b/lib/BlockParser.php @@ -1,4 +1,4 @@ - * * This file is part of PhpWiki. @@ -622,13 +622,13 @@ class Block_table_dl_defn extends XmlContent function setTightness($tight_top, $tight_bot) { $this->_tight_top = $tight_top; $this->_tight_bot = $tight_bot; - $first = $this->firstTR(); - $last = $this->lastTR(); + $first =& $this->firstTR(); + $last =& $this->lastTR(); $first->setInClass('top', $tight_top); if (!empty($last)) { $last->setInClass('bottom', $tight_bot); } else { - trigger_error(sprintf("no lastTR: %s",AsXml($this->_content[0])), E_USER_WARNING); + trigger_error(sprintf("no lastTR: %s",AsXML($this->_content[0])), E_USER_WARNING); } } @@ -1059,6 +1059,9 @@ function TransformText ($text, $markup = 2.0, $basepage=false) { } // $Log: not supported by cvs2svn $ +// Revision 1.46 2004/06/20 14:42:53 rurban +// various php5 fixes (still broken at blockparser) +// // (c-file-style: "gnu") // Local Variables: diff --git a/lib/ErrorManager.php b/lib/ErrorManager.php index be952949b..931ad7258 100644 --- a/lib/ErrorManager.php +++ b/lib/ErrorManager.php @@ -1,4 +1,4 @@ -removeDoublettes($this->_postponed_errors); if ( $error->_count < 2 ) @@ -528,6 +528,9 @@ if (!isset($GLOBALS['ErrorManager'])) { } // $Log: not supported by cvs2svn $ +// Revision 1.28 2004/06/16 11:51:04 rurban +// fixed typo: undefined object #235 +// // Revision 1.27 2004/06/13 09:38:20 rurban // isa() workaround, if stdlib.php is not loaded // diff --git a/lib/WikiDB/adodb/adodb-pear.inc.php b/lib/WikiDB/adodb/adodb-pear.inc.php index 05d148de0..10263e47e 100644 --- a/lib/WikiDB/adodb/adodb-pear.inc.php +++ b/lib/WikiDB/adodb/adodb-pear.inc.php @@ -199,7 +199,7 @@ class DB function isError($value) { return (is_object($value) && - (get_class($value) == 'db_error' || + (strtolower(get_class($value)) == 'db_error' || is_subclass_of($value, 'db_error'))); } @@ -216,7 +216,7 @@ class DB function isWarning($value) { return is_object($value) && - (get_class( $value ) == "db_warning" || + (strtolower(get_class( $value )) == "db_warning" || is_subclass_of($value, "db_warning")); } diff --git a/lib/WikiUserNew.php b/lib/WikiUserNew.php index 8a79c4c2d..9b8c91242 100644 --- a/lib/WikiUserNew.php +++ b/lib/WikiUserNew.php @@ -1,5 +1,5 @@ _auth_methods)) $this->_auth_methods = $GLOBALS['USER_AUTH_ORDER']; if (empty($this->_current_index)) { - if (get_class($this) != '_passuser') { + if (strtolower(get_class($this)) != '_passuser') { $this->_current_method = substr(get_class($this),1,-8); $this->_current_index = $this->array_position($this->_current_method, $this->_auth_methods); @@ -1105,7 +1105,7 @@ extends _AnonUser return _AdoDbPassUser::setPreferences($prefs, $id_only); } elseif ($this->_prefs->_method == 'SQL') { - _PearDbPassUser::_PearDbPassUser($this->_userid,$prefs); + _PearDbPassUser::_PearDbPassUser($this->_userid, $prefs); return _PearDbPassUser::setPreferences($prefs, $id_only); } } @@ -1127,10 +1127,10 @@ extends _AnonUser function userExists() { //if ($this->_HomePagehandle) return true; $class = $this->nextClass(); - while ($user = new $class($this->_userid,$this->_prefs)) { + while ($user = new $class($this->_userid, $this->_prefs)) { //todo: with php5 comment the following line: /*PHP5 patch*/$this = $user; - //UpgradeUser($this,$user); + UpgradeUser($this,$user); if ($user->userExists()) { return true; } @@ -3031,6 +3031,9 @@ extends UserPreferences // $Log: not supported by cvs2svn $ +// Revision 1.98 2004/06/16 21:24:31 rurban +// do not display no-connect warning: #2662 +// // Revision 1.97 2004/06/16 13:21:16 rurban // stabilize on failing ldap queries or bind // diff --git a/lib/XmlElement.php b/lib/XmlElement.php index e86e67383..e9332f23d 100644 --- a/lib/XmlElement.php +++ b/lib/XmlElement.php @@ -1,4 +1,4 @@ -_content, count($this->_content), 0, $item->_content); else @@ -65,7 +65,7 @@ class XmlContent } function _unshiftContent ($item) { - if (get_class($item) == 'xmlcontent') + if (strtolower(get_class($item)) == 'xmlcontent') array_splice($this->_content, 0, 0, $item->_content); else array_unshift($this->_content, $item); @@ -591,6 +591,9 @@ function fmt ($fs /* , ... */) { } // $Log: not supported by cvs2svn $ +// Revision 1.31 2004/06/20 14:42:54 rurban +// various php5 fixes (still broken at blockparser) +// // (c-file-style: "gnu") // Local Variables: diff --git a/lib/nusoap/nusoap.php b/lib/nusoap/nusoap.php index 8b7a35521..62a7ebbdb 100644 --- a/lib/nusoap/nusoap.php +++ b/lib/nusoap/nusoap.php @@ -175,8 +175,9 @@ class nusoap_base { * @return string * @access public */ - function serialize_val($val,$name=false,$type=false,$name_ns=false,$type_ns=false,$attributes=false,$use='encoded'){ - if(is_object($val) && get_class($val) == 'soapval'){ + function serialize_val($val,$name=false,$type=false,$name_ns=false, + $type_ns=false,$attributes=false,$use='encoded') { + if(is_object($val) && strtolower(get_class($val)) == 'soapval'){ return $val->serialize($use); } $this->debug( "in serialize_val: $val, $name, $type, $name_ns, $type_ns, $attributes, $use"); @@ -259,7 +260,7 @@ class nusoap_base { } break; case is_object($val): - $name = get_class($val); + $name = strtolower(get_class($val)); foreach(get_object_vars($val) as $k => $v){ $pXml = isset($pXml) ? $pXml.$this->serialize_val($v,$k,false,false,false,false,$use) : $this->serialize_val($v,$k,false,false,false,false,$use); } @@ -280,7 +281,7 @@ class nusoap_base { $i = 0; if(is_array($val) && count($val)> 0){ foreach($val as $v){ - if(is_object($v) && get_class($v) == 'soapval'){ + if(is_object($v) && strtolower(get_class($v)) == 'soapval'){ $tt = $v->type; } else { $tt = gettype($v); @@ -1986,12 +1987,12 @@ class soap_server extends nusoap_base { // if we got nothing back. this might be ok (echoVoid) if(isset($method_response) && $method_response != '' || is_bool($method_response)) { // if fault - if(get_class($method_response) == 'soap_fault'){ + if(strtolower(get_class($method_response)) == 'soap_fault'){ $this->debug('got a fault object from method'); $this->fault = $method_response; return $method_response->serialize(); // if return val is soapval object - } elseif(get_class($method_response) == 'soapval'){ + } elseif(strtolower(get_class($method_response)) == 'soapval'){ $this->debug('got a soapval object from method'); $return_val = $method_response->serialize(); // returned other diff --git a/lib/pear/Config.php b/lib/pear/Config.php index 26438a4b2..9574209a4 100644 --- a/lib/pear/Config.php +++ b/lib/pear/Config.php @@ -15,7 +15,7 @@ // | Author: Bertrand Mansion | // +----------------------------------------------------------------------+ // -// $Id: Config.php,v 1.4 2004-04-26 20:44:36 rurban Exp $ +// $Id: Config.php,v 1.5 2004-06-20 15:30:06 rurban Exp $ require_once('PEAR.php'); require_once('Config/Container.php'); @@ -158,7 +158,7 @@ class Config { */ function setRoot(&$rootContainer) { - if (is_object($rootContainer) && get_class($rootContainer) == 'config_container') { + if (is_object($rootContainer) && strtolower(get_class($rootContainer)) == 'config_container') { $this->container =& new Config_Container('section', 'root'); $this->container->addItem($rootContainer); return true; diff --git a/lib/pear/DB.php b/lib/pear/DB.php index d3329e6d7..91e4f3142 100644 --- a/lib/pear/DB.php +++ b/lib/pear/DB.php @@ -22,7 +22,7 @@ // The only modifications made have been modification of the include paths, // plus the inclusion depricated DB_Warning class. // -rcs_id('$Id: DB.php,v 1.4 2004-04-26 20:44:36 rurban Exp $'); +rcs_id('$Id: DB.php,v 1.5 2004-06-20 15:30:06 rurban Exp $'); rcs_id('From Pear CVS: Id: DB.php,v 1.20 2003/05/07 16:54:45 mj Exp'); // // Database independent query interface. @@ -340,7 +340,7 @@ class DB function isError($value) { return (is_object($value) && - (get_class($value) == 'db_error' || + (strtolower(get_class($value)) == 'db_error' || is_subclass_of($value, 'db_error'))); } diff --git a/lib/pear/DB/common.php b/lib/pear/DB/common.php index 8fc4a0e56..0ad65ca8f 100644 --- a/lib/pear/DB/common.php +++ b/lib/pear/DB/common.php @@ -19,7 +19,7 @@ // Based on DB 1.3 from the pear.php.net repository. // The only modifications made have been modification of the include paths. // -rcs_id('$Id: common.php,v 1.3 2004-02-07 10:41:25 rurban Exp $'); +rcs_id('$Id: common.php,v 1.4 2004-06-20 15:30:06 rurban Exp $'); rcs_id('From Pear CVS: Id: common.php,v 1.15 2003/05/07 16:58:28 mj Exp'); // // Base class for DB implementations. @@ -761,7 +761,7 @@ class DB_common extends PEAR { $query = $this->modifyLimitQuery($query, $from, $count); $result = $this->query($query, $params); - if (DB::isError($result) || get_class($result) == 'db_result' || + if (DB::isError($result) || strtolower(get_class($result)) == 'db_result' || $result === DB_OK) { return $result; } else { diff --git a/lib/pear/PEAR.php b/lib/pear/PEAR.php index 040379c19..380980e71 100644 --- a/lib/pear/PEAR.php +++ b/lib/pear/PEAR.php @@ -18,7 +18,7 @@ // | Tomas V.V.Cox | // +----------------------------------------------------------------------+ // -rcs_id('$Id: PEAR.php,v 1.2 2004-02-04 17:04:18 rurban Exp $'); +rcs_id('$Id: PEAR.php,v 1.3 2004-06-20 15:30:06 rurban Exp $'); rcs_id('From Pear CVS: Id: PEAR.php,v 1.59 2003/04/03 23:10:10 ssb Exp'); // @@ -231,7 +231,7 @@ class PEAR */ function isError($data, $code = null) { - if (is_object($data) && (get_class($data) == 'pear_error' || + if (is_object($data) && (strtolower(get_class($data)) == 'pear_error' || is_subclass_of($data, 'pear_error'))) { if (is_null($code)) { return true; @@ -839,7 +839,7 @@ class PEAR_Error */ function getType() { - return get_class($this); + return strtolower(get_class($this)); } // }}} -- 2.45.0