From 2220fbd6ed607d6b3f85a7972b79f90dc5841695 Mon Sep 17 00:00:00 2001 From: Linsly <39582509+bvbnjghui@users.noreply.github.com> Date: Tue, 3 May 2022 15:33:38 +0800 Subject: [PATCH] Update phpQuery.php there might be a head tag with attributes --- phpQuery.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/phpQuery.php b/phpQuery.php index 90391cd..b9c70a2 100644 --- a/phpQuery.php +++ b/phpQuery.php @@ -530,9 +530,9 @@ protected function charsetFixHTML($markup) $metaContentType = $matches[0][0]; $markup = substr($markup, 0, $matches[0][1]) . substr($markup, $matches[0][1] + strlen($metaContentType)); - $headStart = stripos($markup, ''); - $markup = substr($markup, 0, $headStart + 6) . $metaContentType - . substr($markup, $headStart + 6); + $headStart = strpos($markup, '>', stripos($markup, '