diff options
author | Laria Carolin Chabowski <laria@laria.me> | 2020-09-25 21:24:01 +0200 |
---|---|---|
committer | Laria Carolin Chabowski <laria@laria.me> | 2020-09-25 21:27:43 +0200 |
commit | 78c0350b3b7fc025ba565e19bfa195b68e95bb88 (patch) | |
tree | 94ac3aba1cba328a7e50bac408e72c269d18d9b4 /ratatoeskr/sys/utils.php | |
parent | 60542d424f71347e75e3e43daf964f679cf26aee (diff) | |
download | ratatoeskr-cms-78c0350b3b7fc025ba565e19bfa195b68e95bb88.tar.gz ratatoeskr-cms-78c0350b3b7fc025ba565e19bfa195b68e95bb88.tar.bz2 ratatoeskr-cms-78c0350b3b7fc025ba565e19bfa195b68e95bb88.zip |
Deprecate htmlesc for Esc::esc
"Stole" this class from another project of mine (micropoly)
Diffstat (limited to 'ratatoeskr/sys/utils.php')
-rw-r--r-- | ratatoeskr/sys/utils.php | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/ratatoeskr/sys/utils.php b/ratatoeskr/sys/utils.php index a285bcd..8a848eb 100644 --- a/ratatoeskr/sys/utils.php +++ b/ratatoeskr/sys/utils.php @@ -22,6 +22,9 @@ * * An array with $val $n-times repeated. */ + +use r7r\cms\sys\Esc; + function array_repeat($val, $n) { $rv = []; @@ -40,19 +43,16 @@ function intcmp($a, $b) return ($a == $b) ? 0 : (($a < $b) ? -1 : 1); } -/* - * Function: htmlesc +/** * Escape HTML (shorter than htmlspecialchars) * - * Parameters: - * $text - Input text. - * - * Returns: - * HTML + * @param mixed $text Input text + * @return string HTML + * @deprecated Use {@see Esc::esc()} instead. */ -function htmlesc($text) +function htmlesc($text): string { - return htmlspecialchars($text, ENT_QUOTES, "UTF-8"); + return Esc::esc($text); } /* |