Merge pull request #145 from maxiaozhi/master

正则匹配成功时才替换掉html
This commit is contained in:
Jaeger(黄杰) 2021-08-08 13:04:55 +08:00 committed by GitHub
commit 894fb4344e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;
}