From 78c0350b3b7fc025ba565e19bfa195b68e95bb88 Mon Sep 17 00:00:00 2001 From: Laria Carolin Chabowski Date: Fri, 25 Sep 2020 21:24:01 +0200 Subject: Deprecate htmlesc for Esc::esc "Stole" this class from another project of mine (micropoly) --- ratatoeskr/sys/utils.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'ratatoeskr/sys/utils.php') 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); } /* -- cgit v1.2.3-70-g09d2