diff --git a/lib/Haanga/lib/Haanga/Extension/Filter/Decodehtml.php b/lib/Haanga/lib/Haanga/Extension/Filter/Decodehtml.php index abddc0b873aea7e088f32cb2867ad84a56467661..b01a920c2377fd2834e231cffe1e6d330cff2112 100644 --- a/lib/Haanga/lib/Haanga/Extension/Filter/Decodehtml.php +++ b/lib/Haanga/lib/Haanga/Extension/Filter/Decodehtml.php @@ -3,12 +3,13 @@ class Haanga_Extension_Filter_Decodehtml { static function main($text) { - $allowed_tags ="<b><i><strong><br><p><ul><ol><li><u>"; - $allowed_tags_regex= preg_replace('/\|$/','',preg_replace('/<([^>]+)>/','$1|',$allowed_tags)); - $allowed_tags_regex_strip_not_name = "/<(". $allowed_tags_regex . ")[^>]+>/"; + $allowed_tags ="<u><b><i><strong><br><p><ul><ol><li>"; + $allowed_tags_regex= preg_replace('/\|$/','',preg_replace('/<([^>^\s]+)>/','$1|',$allowed_tags)); + $allowed_tags_regex_strip_not_name = "/<(". $allowed_tags_regex . ")\s+[^>]+>/"; // public $php_alias = "html_entity_decode"; // public $is_safe = TRUE; /* a number if safe */ <b> <b;>, < > -> - return preg_replace($allowed_tags_regex_strip_not_name,'$1',strip_tags(html_entity_decode(htmlspecialchars(html_entity_decode($text,ENT_QUOTES,"UTF-8"),ENT_QUOTES,"UTF-8"),ENT_QUOTES,"UTF-8"),$allowed_tags)); + # return $allowed_tags_regex_strip_not_name; + return preg_replace($allowed_tags_regex_strip_not_name,'<$1>',strip_tags(html_entity_decode(htmlspecialchars(html_entity_decode($text,ENT_QUOTES,"UTF-8"),ENT_QUOTES,"UTF-8"),ENT_QUOTES,"UTF-8"),$allowed_tags)); # return htmlspecialchars($allowed_tags_regex); }}