Skip to content

Commit

Permalink
Merge pull request #1 from Darhazer/patch-1
Browse files Browse the repository at this point in the history
Bugfix: return the DOMNodeList, if $as_array is false
  • Loading branch information
Darhazer committed Jul 30, 2013
2 parents 6eab940 + 2b45882 commit 8115457
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions selector.inc
Expand Up @@ -25,7 +25,7 @@ class SelectorDOM {

public function select($selector, $as_array = true) {
$elements = $this->xpath->evaluate(selector_to_xpath($selector));
return $as_array ? elements_to_array($elements) : $element;
return $as_array ? elements_to_array($elements) : $elements;
}
}

Expand Down Expand Up @@ -125,4 +125,4 @@ function selector_to_xpath($selector) {
$selector = str_replace(']*', ']', $selector);
$selector = str_replace(']/*', ']', $selector);
return $selector;
}
}

0 comments on commit 8115457

Please sign in to comment.