diff options
| author | 2014-08-24 15:29:09 +0200 | |
|---|---|---|
| committer | 2014-08-24 15:29:09 +0200 | |
| commit | 07444280d1a03daa7880c1539bde3a6e80945dab (patch) | |
| tree | c328a11f59e07d12e624576ed86b11ada1b9d198 /lib/Minz/Helper.php | |
| parent | 1d2527b8bc2a125cc8b8508402417f60d314e330 (diff) | |
| parent | d1f79fee69a3667913f419cd9726ffb11f410bd0 (diff) | |
Merge branch 'dev' into beta
Conflicts:
README.md
Diffstat (limited to 'lib/Minz/Helper.php')
| -rw-r--r-- | lib/Minz/Helper.php | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/lib/Minz/Helper.php b/lib/Minz/Helper.php index b058211d3..f4a547c4e 100644 --- a/lib/Minz/Helper.php +++ b/lib/Minz/Helper.php @@ -12,11 +12,22 @@ class Minz_Helper { * Annule les effets des magic_quotes pour une variable donnée * @param $var variable à traiter (tableau ou simple variable) */ - public static function stripslashes_r ($var) { - if (is_array ($var)){ - return array_map (array ('Helper', 'stripslashes_r'), $var); + public static function stripslashes_r($var) { + if (is_array($var)){ + return array_map(array('Minz_Helper', 'stripslashes_r'), $var); } else { return stripslashes($var); } } + + /** + * Wrapper for htmlspecialchars. + * Force UTf-8 value and can be used on array too. + */ + public static function htmlspecialchars_utf8($var) { + if (is_array($var)) { + return array_map(array('Minz_Helper', 'htmlspecialchars_utf8'), $var); + } + return htmlspecialchars($var, ENT_COMPAT, 'UTF-8'); + } } |
