aboutsummaryrefslogtreecommitdiffstats
path: root/rss.php
diff options
context:
space:
mode:
authorAleteoryx <alyx@aleteoryx.me>2024-11-14 17:53:05 -0500
committerAleteoryx <alyx@aleteoryx.me>2024-11-14 17:56:03 -0500
commit10f26c2ae98dd1414e3b84fea400478f28d742a6 (patch)
treeff9df87e9de55527c82ccb5a1ae141ca7810ea08 /rss.php
parented7eeb11c74bd8fedf40d0618e34c4a6c1f5b10a (diff)
downloadrss_dot_php-10f26c2ae98dd1414e3b84fea400478f28d742a6.tar.gz
rss_dot_php-10f26c2ae98dd1414e3b84fea400478f28d742a6.tar.bz2
rss_dot_php-10f26c2ae98dd1414e3b84fea400478f28d742a6.zip
better stripping
Diffstat (limited to 'rss.php')
-rw-r--r--rss.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/rss.php b/rss.php
index 4efb696..2669085 100644
--- a/rss.php
+++ b/rss.php
@@ -175,6 +175,19 @@ function strip_html(string $html): string {
$el->remove();
foreach($doc->getElementsByTagName("link")->getIterator() as $el)
$el->remove();
+ foreach($doc->getElementsByTagName("meta")->getIterator() as $el)
+ $el->remove();
+ foreach($doc->getElementsByTagName("base")->getIterator() as $el)
+ $el->remove();
+ foreach($doc->getElementsByTagName("title")->getIterator() as $el)
+ $el->remove();
+ foreach($doc->getElementsByTagName("template")->getIterator() as $el)
+ $el->remove();
+ foreach($doc->getElementsByTagName("slot")->getIterator() as $el)
+ $el->remove();
+
+ foreach($doc->getElementsByTagName("img")->getIterator() as $el)
+ $el->setAttribute("loading", "lazy");
foreach($doc->getElementsByTagName("*")->getIterator() as $el) {
if (str_starts_with($el->getAttribute("href"), "javascript:"))