From e4fc716acd6019aa96a3574932f5a04a2ef4633b Mon Sep 17 00:00:00 2001 From: lion <19340091@qq.com> Date: Sun, 18 Jul 2021 23:37:35 +0800 Subject: [PATCH] =?UTF-8?q?=E6=AD=A3=E5=88=99=E5=8C=B9=E9=85=8D=E6=88=90?= =?UTF-8?q?=E5=8A=9F=E6=97=B6=E6=89=8D=E6=9B=BF=E6=8D=A2=E6=8E=89html?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Dom/Query.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Dom/Query.php b/src/Dom/Query.php index 2899c3c..93b8daf 100644 --- a/src/Dom/Query.php +++ b/src/Dom/Query.php @@ -125,8 +125,8 @@ class Query */ public function removeHead() { - $html = preg_replace('/(<head>|<head\s+.+?>).+<\/head>/is', '<head></head>', $this->html); - $this->setHtml($html); + $html = preg_replace('/(<head>|<head\s+.+?>).+?<\/head>/is', '<head></head>', $this->html); + $html && $this->setHtml($html); return $this->ql; }