Permalink
Browse files

fixing #24559 - dont complain im waiting for feedback since 31 jul.

git-svn-id: http://svn.php.net/repository/pear/packages/XML_XPath/trunk@137549 c90b9560-bf6c-de11-be94-00142212c4b1
  • Loading branch information...
1 parent 9b09f03 commit eeee6e9ee4cd9735abf9ae73c8c9052022cf1e44 CHAILLAN Nicolas committed Aug 12, 2003
Showing with 6 additions and 4 deletions.
  1. +4 −2 XPath.php
  2. +2 −2 XPath/common.php
View
@@ -126,7 +126,8 @@ function load($in_xml, $in_type = 'string')
// 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') {
+ // get_class returns a lowercase name
+ if ($in_type == 'object' && get_class($in_xml) == 'domdocument') {
$this->xml = $in_xml;
}
// we can read the file, so use xmldocfile to make a xmldom object
@@ -145,7 +146,8 @@ function load($in_xml, $in_type = 'string')
$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') {
+ // get_class returns a lowercase name
+ if (get_class($this->xml) == 'domdocument') {
$this->loaded = true;
$this->ctx = $this->xml->xpath_new_context();
$this->pointer = $this->xml->root();
View
@@ -1427,7 +1427,7 @@ function getOne($in_xpathQuery, $in_movePointer = false)
function &evaluate($in_xpathQuery, $in_movePointer = false)
{
// Make sure we have loaded an xml document and were able to create an xpath context
- if (get_class($this->ctx) != 'XPathContext') {
+ if (get_class($this->ctx) != 'xpathcontext') {
return PEAR::raiseError(null, XML_XPATH_NOT_LOADED, null, E_USER_ERROR, null, 'XML_XPath_Error', true);
}
@@ -1621,7 +1621,7 @@ function _quick_evaluate_init($in_xpathQuery = null, $in_movePointer = false, $i
// doing the following manually (without evaluate()) is critical for speed
// Make sure we have an xpath context (mildly costly)
- if (get_class($this->ctx) != 'XPathContext') {
+ if (get_class($this->ctx) != 'xpathcontext') {
return PEAR::raiseError(null, XML_XPATH_NOT_LOADED, null, E_USER_ERROR, null, 'XML_XPath_Error', true);
}

0 comments on commit eeee6e9

Please sign in to comment.