From 3595a05361ac372ccc2e2b8d6b5b9bc1f0de2c33 Mon Sep 17 00:00:00 2001 From: Christian Schneider Date: Sun, 30 May 2021 08:23:34 +0200 Subject: Allow some more tags structuring texts visibly --- it_html.class | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'it_html.class') diff --git a/it_html.class b/it_html.class index fb26544..70994e7 100644 --- a/it_html.class +++ b/it_html.class @@ -395,7 +395,7 @@ function _strip_tags($html) /** * Return HTML with all evil things stripped. Allowed are a coupld of simple - * tags like div, p, i, b, br without attributes, a with absolute href, + * tags like div, p, i, b, strong, h1 - h6, br without attributes, a with absolute href, * img with absolute src url. Also ensures that tags are balanced. * @param $html HTML string to be sanitized * @return Sanitized HTML @@ -409,7 +409,7 @@ static function sanitize($html) $html = it::replace(array('[\0\s]+' => " "), $html); # \s also matches \r and \n $urlpattern = 'https?://[^">]+'; - if ($tag = it::match("(.*)<(div|p|i|b)\b[^>]*>(.*?)(.*)", $html)) + if ($tag = it::match("(.*)<(div|p|i|b|strong|h[1-6])\b[^>]*>(.*?)(.*)", $html)) { # Simple tags with content, no attributes kept list($head, $tagname, $content, $tail) = $tag; -- cgit v1.2.3