mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-07-29 04:40:19 +02:00
[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:
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user