Compare commits

..

5 Commits

Author SHA1 Message Date
Jaeger(黄杰)
894fb4344e
Merge pull request #145 from maxiaozhi/master
正则匹配成功时才替换掉html
2021-08-08 13:04:55 +08:00
lion
e4fc716acd 正则匹配成功时才替换掉html 2021-07-18 23:37:35 +08:00
Jaeger(黄杰)
39dc0ca9c6
Merge pull request #143 from maxiaozhi/patch-1
Fix the matching exception
2021-07-05 14:07:58 +08:00
maxiaozhi
ef0a2efd4f
Fix the matching exception
Fix the matching exception when the page contains multiple tags prefixed with head (for example: < head >, < header >)
2021-07-05 13:51:24 +08:00
huangjie
5953daac54 update collect 2020-12-14 10:39:28 +08:00
3 changed files with 5 additions and 4 deletions

3
.gitignore vendored
View File

@ -1,4 +1,5 @@
/vendor/
.idea/
composer.lock
.DS_Store
.DS_Store
*.cache

View File

@ -8,7 +8,7 @@
"jaeger/phpquery-single": "^1",
"jaeger/g-http": "^1.1",
"ext-dom": "*",
"tightenco/collect": "^8.0"
"tightenco/collect": ">5.0"
},
"suggest":{

View File

@ -125,8 +125,8 @@ class Query
*/
public function removeHead()
{
$html = preg_replace('/<head.+?>.+<\/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;
}