From f29a78a6af6dde9f7d111f153226592eea6929eb Mon Sep 17 00:00:00 2001 From: fusionate Date: Fri, 5 May 2023 17:00:39 +0000 Subject: [PATCH] Functions: Adjust escape function to handle non-strings (XML objects). --- resources/functions.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/resources/functions.php b/resources/functions.php index f0479fb394..1c98ae176b 100644 --- a/resources/functions.php +++ b/resources/functions.php @@ -1892,8 +1892,15 @@ function number_pad($number,$n) { //escape user data function escape($string) { - if (is_string($string)) + if (is_string($string)) { return htmlentities($string, ENT_QUOTES | ENT_HTML5, 'UTF-8'); + } + else { + $string = (array) $string; + if (is_string($string[0])) { + return htmlentities($string[0], ENT_QUOTES | ENT_HTML5, 'UTF-8'); + } + } return false; }