|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2003-07-09 05:55 UTC] lsmith@php.net
Description: ------------ There are several bugs related to comparing a calls to get_class with a mixed case string (get_class always returns lower case strings): get_class($in_xml) == 'DomDocument' Furthermore the examples do not work. PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 13:00:02 2025 UTC |
Can anyone take a look at this fix? Index: XPath.php =================================================================== RCS file: /repository/pear/XML_XPath/XPath.php,v retrieving revision 1.16 diff -u -u -r1.16 XPath.php --- XPath.php 16 Jan 2003 19:10:51 -0000 1.16 +++ XPath.php 31 Jul 2003 09:11:40 -0000 @@ -126,7 +126,7 @@ // we need to capture errors, since there is not interface for this ob_start(); // in this case, we already have an xmldom object - if ($in_type == 'object' && get_class($in_xml) == 'DomDocument') { + if ($in_type == 'object' && strtolower(get_class($in_xml)) == 'domdocument') { $this->xml = $in_xml; } // we can read the file, so use xmldocfile to make a xmldom object @@ -145,7 +145,7 @@ $loadError = ob_get_contents(); ob_end_clean(); // make sure a domxml object was created, and if so initialized the state - if (get_class($this->xml) == 'DomDocument') { + if (strtolower(get_class($this->xml)) == 'domdocument') { $this->loaded = true; $this->ctx = $this->xml->xpath_new_context(); $this->pointer = $this->xml->root();