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

rename Hangaa extension and fix striptags

parent 48e8f208
No related branches found
No related tags found
No related merge requests found
<?php
//decodes a any text containing a
class Haanga_Extension_Filter_Decodedescription
{
static function main($text) {
$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+[^>]+>/";
$description= 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));
preg_match("/<p(\s[^>]*)?>/i",$description,$matches);
if ($matches)
{}
else
{$description="<p>".$description . "</p>";}
// public $php_alias = "html_entity_decode";
// public $is_safe = TRUE; /* a number if safe */ <b> &ltb;&gt, &lt; &gt; ->
# return $allowed_tags_regex_strip_not_name;
return $description;
# return htmlspecialchars($allowed_tags_regex);
}}
......@@ -4,6 +4,6 @@ class Haanga_Extension_Filter_Striptags
{
static function main($text)
{
return htmlentities(strip_tags($text));
return strip_tags($text);
}
}
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