diff options
author | Christian Schneider | 2021-05-30 08:23:34 +0200 |
---|---|---|
committer | Christian Schneider | 2021-05-30 08:23:34 +0200 |
commit | 3595a05361ac372ccc2e2b8d6b5b9bc1f0de2c33 (patch) | |
tree | 7d16ec43aabb9ab689643ea8edc3236e21a3d854 /it_html.class | |
parent | 741c2b05811e7f3bf3b17c9f55957336f791c08c (diff) | |
download | itools-3595a05361ac372ccc2e2b8d6b5b9bc1f0de2c33.tar.gz itools-3595a05361ac372ccc2e2b8d6b5b9bc1f0de2c33.tar.bz2 itools-3595a05361ac372ccc2e2b8d6b5b9bc1f0de2c33.zip |
Allow some more tags structuring texts visibly
Diffstat (limited to 'it_html.class')
-rw-r--r-- | it_html.class | 4 |
1 files changed, 2 insertions, 2 deletions
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[^>]*>(.*?)</\\2>(.*)", $html)) + if ($tag = it::match("(.*)<(div|p|i|b|strong|h[1-6])\b[^>]*>(.*?)</\\2>(.*)", $html)) { # Simple tags with content, no attributes kept list($head, $tagname, $content, $tail) = $tag; |