forked from blallo/rss-bridge
[WordPress] Remove forms and improve script removal
Some sites contain scripts like these, that were not captured by the previous implementation: <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
This commit is contained in:
parent
2c41ed550d
commit
870ef6f6fc
1 changed files with 2 additions and 1 deletions
|
@ -49,8 +49,9 @@ class WordPressBridge extends BridgeAbstract {
|
||||||
}
|
}
|
||||||
|
|
||||||
function ClearContent($content) {
|
function ClearContent($content) {
|
||||||
$content = preg_replace('/<script.*\/script>/', '', $content);
|
$content = preg_replace('/<script[^>]*>[^<]*<\/script>/', '', $content);
|
||||||
$content = preg_replace('/<div class="wpa".*/', '', $content);
|
$content = preg_replace('/<div class="wpa".*/', '', $content);
|
||||||
|
$content = preg_replace('/<form.*\/form>/', '', $content);
|
||||||
return $content;
|
return $content;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue