Files
FreshRSS/lib/Minz/Helper.php
Alexandre Alapetite 288ed04ccc PHPStan level 6 for all PDO and Exception classes (#5239)
* PHPStan level 6 for all PDO and Exception classes
Contributes to https://github.com/FreshRSS/FreshRSS/issues/4112

* Fix type

* Now also our remaining own librairies

* Motivation for a few more files

* A few more DAO classes

* Last interface
2023-03-31 08:23:39 +02:00

28 lines
639 B
PHP

<?php
/**
* MINZ - Copyright 2011 Marien Fressinaud
* Sous licence AGPL3 <http://www.gnu.org/licenses/>
*/
/**
* The Minz_Helper class contains some misc. help functions
*/
class Minz_Helper {
/**
* Wrapper for htmlspecialchars.
* Force UTf-8 value and can be used on array too.
* @param string|array<string> $var
* @return string|array<string>
*/
public static function htmlspecialchars_utf8($var) {
if (is_array($var)) {
return array_map(array('Minz_Helper', 'htmlspecialchars_utf8'), $var);
} elseif (is_string($var)) {
return htmlspecialchars($var, ENT_COMPAT, 'UTF-8');
} else {
return $var;
}
}
}