Merge pull request #143 from maxiaozhi/patch-1

Fix the matching exception
This commit is contained in:
Jaeger(黄杰) 2021-07-05 14:07:58 +08:00 committed by GitHub
commit 39dc0ca9c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -125,7 +125,7 @@ class Query
*/
public function removeHead()
{
$html = preg_replace('/<head.+?>.+<\/head>/is', '<head></head>', $this->html);
$html = preg_replace('/(<head>|<head\s+.+?>).+<\/head>/is', '<head></head>', $this->html);
$this->setHtml($html);
return $this->ql;
}