aboutsummaryrefslogtreecommitdiff
path: root/lib/Minz/Helper.php
diff options
context:
space:
mode:
authorGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2014-08-12 21:56:34 +0200
committerGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2014-08-12 21:56:34 +0200
commit7900c5e550acafaf0b877635840a8a270eb06078 (patch)
tree9702d865c7ffb105bc0b0619f6ef99f82e3c8c61 /lib/Minz/Helper.php
parentede94098be5d330d4bf120eb8064c5c87eed7ef0 (diff)
Move htmlspecialchars_utf8 from Request to Helper
And remove html_chars_utf8 to use htmlspecialchars_utf8 instead in importExportController
Diffstat (limited to 'lib/Minz/Helper.php')
-rw-r--r--lib/Minz/Helper.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/Minz/Helper.php b/lib/Minz/Helper.php
index b058211d3..13bfdd93e 100644
--- a/lib/Minz/Helper.php
+++ b/lib/Minz/Helper.php
@@ -19,4 +19,15 @@ class Minz_Helper {
return stripslashes($var);
}
}
+
+ /**
+ * Wrapper for htmlspecialchars.
+ * Force UTf-8 value and can be used on array too.
+ */
+ public static function htmlspecialchars_utf8($p) {
+ if (is_array($p)) {
+ return array_map('self::htmlspecialchars_utf8', $p);
+ }
+ return htmlspecialchars($p, ENT_COMPAT, 'UTF-8');
+ }
}