Skip to content
Snippets Groups Projects
Commit 48e8f208 authored by Øyvind Gjesdal's avatar Øyvind Gjesdal
Browse files

tatt in space etter elementnavn

parent 98416536
No related branches found
No related tags found
No related merge requests found
......@@ -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> &ltb;&gt, &lt; &gt; ->
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);
}}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment