Functions: Adjust escape function to handle non-strings (XML objects).

This commit is contained in:
fusionate 2023-05-05 17:00:39 +00:00
parent 6e7c50cba5
commit f29a78a6af
No known key found for this signature in database
1 changed files with 8 additions and 1 deletions

View File

@ -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;
}