From ef0a2efd4f9f88bb8d9b27e35ecd7d8fd09f845c Mon Sep 17 00:00:00 2001 From: maxiaozhi <34503138+maxiaozhi@users.noreply.github.com> Date: Mon, 5 Jul 2021 13:51:24 +0800 Subject: [PATCH] Fix the matching exception Fix the matching exception when the page contains multiple tags prefixed with head (for example: < head >, < header >) --- src/Dom/Query.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Dom/Query.php b/src/Dom/Query.php index 9e75bea..2899c3c 100644 --- a/src/Dom/Query.php +++ b/src/Dom/Query.php @@ -125,7 +125,7 @@ class Query */ public function removeHead() { - $html = preg_replace('/.+<\/head>/is', '', $this->html); + $html = preg_replace('/(|).+<\/head>/is', '', $this->html); $this->setHtml($html); return $this->ql; }