technosophos / querypath

QueryPath is a PHP library for manipulating XML and HTML. It is designed to work not only with local files, but also with web services and database resources.
http://querypath.org
Other
823 stars 115 forks source link

PHP Notice: Undefined variable: string in /path/to/app/vendor/querypath/querypath/src/QueryPath.php on line 240 #147

Closed sandeepshetty closed 9 years ago

sandeepshetty commented 9 years ago

$string here is undefined. https://github.com/technosophos/querypath/blob/59fd8d48c9cc717cf21034079e69569e5577865b/src/QueryPath.php#L240

Plus, the if and the else there are both doing the same thing?!

      if (strpos($string, '<') !== FALSE && strpos($string, '>') !== FALSE) {
        $source = $html5->loadHTML($source);
      }
      else {
        $source = $html5->loadHTML($source);
      }

What gives?

eleazan commented 9 years ago

I think that correct is $source, not $string...

But yes, the conditional is... how to say? No make sense...

Maybe should be like: https://github.com/technosophos/querypath/blob/59fd8d48c9cc717cf21034079e69569e5577865b/src/QueryPath/DOMQuery.php#L3752

technosophos commented 9 years ago

This is a duplicate of #143. If someone could issue a pull request, I'll merge it.

sandeepshetty commented 9 years ago

@technosophos here you go: https://github.com/technosophos/querypath/pull/148

technosophos commented 9 years ago

I merged #148, so I am closing this.