aboutsummaryrefslogtreecommitdiff
path: root/lib/html.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/html.php')
-rw-r--r--lib/html.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/html.php b/lib/html.php
index 4a4bea1b..693504b0 100644
--- a/lib/html.php
+++ b/lib/html.php
@@ -98,6 +98,15 @@ function sanitize(
return $htmlContent;
}
+function sanitize_html(string $html): string
+{
+ $html = str_replace('<script', '<&zwnj;script', $html); // Disable scripts, but leave them visible.
+ $html = str_replace('<iframe', '<&zwnj;iframe', $html);
+ $html = str_replace('<link', '<&zwnj;link', $html);
+ // We leave alone object and embed so that videos can play in RSS readers.
+ return $html;
+}
+
/**
* Replace background by image
*