#24559 [Ana->Csd]: XML_Xpath class has several showstopper bugs

From: Date: Tue, 12 Aug 2003 23:38:01 +0000
Subject: #24559 [Ana->Csd]: XML_Xpath class has several showstopper bugs
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-19619@lists.php.net to get a copy of this message
ID: 24559 Updated by: nicos@php.net Reported By: lsmith@php.net -Status: Analyzed +Status: Closed Bug Type: PEAR related Operating System: Win2k PHP Version: Irrelevant Assigned To: dallen New Comment: This bug has been fixed in CVS. In case this was a PHP problem, snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. In case this was a documentation problem, the fix will show up soon at http://www.php.net/manual/. In case this was a PHP.net website problem, the change will show up on the PHP.net site and on the mirror sites in short time. Thank you for the report, and for helping us make PHP better. Previous Comments: ------------------------------------------------------------------------ [2003-07-31 04:12:04] nicos@php.net 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(); ------------------------------------------------------------------------ [2003-07-09 05:55:13] 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. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=24559&edit=1

« previous php.pear.dev (#19619) next »