1
0
Fork 0
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:
logmanoriginal 2016-08-04 21:42:06 +02:00
parent 2c41ed550d
commit 870ef6f6fc

View file

@ -49,8 +49,9 @@ class WordPressBridge extends BridgeAbstract {
}
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('/<form.*\/form>/', '', $content);
return $content;
}