We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents e85e379 + 1fd9741 commit 72f8510Copy full SHA for 72f8510
src/PHPHtmlParser/Selector.php
@@ -6,6 +6,7 @@
6
use PHPHtmlParser\Dom\InnerNode;
7
use PHPHtmlParser\Dom\LeafNode;
8
use PHPHtmlParser\Exceptions\ChildNotFoundException;
9
+use Countable;
10
11
/**
12
* Class Selector
@@ -168,7 +169,9 @@ protected function parseSelectorString($selector)
168
169
protected function seek(array $nodes, array $rule, array $options)
170
{
171
// XPath index
- if (count($rule['tag']) > 0 &&
172
+ if ($rule['tag'] instanceof Countable &&
173
+ count($rule['tag']) > 0 &&
174
+ $rule['key'] instanceof Countable &&
175
count($rule['key']) > 0 &&
176
is_numeric($rule['key'])
177
) {
0 commit comments