Skip to content
Snippets Groups Projects
Commit 0ff154eb authored by Jared Hancock's avatar Jared Hancock
Browse files

Property handle Unicode and HTML entities

parent 44feb00d
No related branches found
No related tags found
No related merge requests found
......@@ -88,7 +88,12 @@ class Format {
}
function htmlchars($var) {
return is_array($var)?array_map(array('Format','htmlchars'),$var):htmlspecialchars($var,ENT_QUOTES);
$flags = ENT_COMPAT | ENT_QUOTES;
if (phpversion() >= '5.4.0')
$flags |= ENT_HTML401;
return is_array($var)
? array_map(array('Format','htmlchars'),$var)
: htmlentities($var, $flags, 'UTF-8');
}
function input($var) {
......@@ -114,7 +119,13 @@ class Format {
}
function striptags($var) {
return is_array($var)?array_map(array('Format','striptags'),$var):strip_tags(html_entity_decode($var)); //strip all tags ...no mercy!
$flags = ENT_COMPAT;
if (phpversion() >= '5.4.0')
$flags |= ENT_HTML401;
return is_array($var)
? array_map(array('Format','striptags'),$var)
//strip all tags ...no mercy!
: strip_tags(html_entity_decode($var, $flags, 'UTF-8'));
}
//make urls clickable. Mainly for display
......
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