#24559 [Asn->Ana]: XML_Xpath class has several showstopper bugs
| From: | nicos@php.net | Date: | Thu, 31 Jul 2003 09:12:05 +0000 |
| Subject: | #24559 [Asn->Ana]: XML_Xpath class has several showstopper bugs | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-19013@lists.php.net to get a copy of this message | ||
ID: 24559
Updated by: nicos@php.net
Reported By: lsmith@php.net
-Status: Assigned
+Status: Analyzed
Bug Type: PEAR related
Operating System: Win2k
PHP Version: Irrelevant
Assigned To: dallen
New Comment:
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();
Previous Comments:
------------------------------------------------------------------------
[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