Fix the matching exception
Fix the matching exception when the page contains multiple tags prefixed with head (for example: < head >, < header >)
This commit is contained in:
parent
5953daac54
commit
ef0a2efd4f
@ -125,7 +125,7 @@ class Query
|
|||||||
*/
|
*/
|
||||||
public function removeHead()
|
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);
|
$this->setHtml($html);
|
||||||
return $this->ql;
|
return $this->ql;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user