aboutsummaryrefslogtreecommitdiff
path: root/lib/Minz/Helper.php
blob: 5fddbf91c5fc34283a5c182a3f8d94d8bc1984ae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?php
/**
 * MINZ - Copyright 2011 Marien Fressinaud
 * Sous licence AGPL3 <http://www.gnu.org/licenses/>
*/

/**
 * La classe Helper représente une aide pour des tâches récurrentes
 */
class Minz_Helper {

	/**
	 * 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');
	}
}