Helper.php 521 B

12345678910111213141516171819202122
  1. <?php
  2. /**
  3. * MINZ - Copyright 2011 Marien Fressinaud
  4. * Sous licence AGPL3 <http://www.gnu.org/licenses/>
  5. */
  6. /**
  7. * La classe Helper représente une aide pour des tâches récurrentes
  8. */
  9. class Minz_Helper {
  10. /**
  11. * Wrapper for htmlspecialchars.
  12. * Force UTf-8 value and can be used on array too.
  13. */
  14. public static function htmlspecialchars_utf8($var) {
  15. if (is_array($var)) {
  16. return array_map(array('Minz_Helper', 'htmlspecialchars_utf8'), $var);
  17. }
  18. return htmlspecialchars($var, ENT_COMPAT, 'UTF-8');
  19. }
  20. }