From 56bec9d063e462651e64a07214670922a8324252 Mon Sep 17 00:00:00 2001 From: ncwgf Date: Wed, 13 Dec 2017 00:58:05 +0800 Subject: [PATCH] fix for PHP 7.2 --- src/PHPHtmlParser/Selector.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/PHPHtmlParser/Selector.php b/src/PHPHtmlParser/Selector.php index e0e1ac73..a1f4756d 100644 --- a/src/PHPHtmlParser/Selector.php +++ b/src/PHPHtmlParser/Selector.php @@ -168,8 +168,8 @@ protected function parseSelectorString($selector) protected function seek(array $nodes, array $rule, array $options) { // XPath index - if (count($rule['tag']) > 0 && - count($rule['key']) > 0 && + if (strlen($rule['tag']) > 0 && + strlen($rule['key']) > 0 && is_numeric($rule['key']) ) { $count = 0;