From 5de0e9c57f3b6250c200de7f4c80cc49bd8d2cbb Mon Sep 17 00:00:00 2001 From: Thomas Pike Date: Fri, 22 Dec 2023 22:00:28 +0000 Subject: [PATCH] Fix null string handling --- core.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core.php b/core.php index 3808fcf..90a2ec0 100644 --- a/core.php +++ b/core.php @@ -113,6 +113,7 @@ define('ESC_NONE', 9); * @param integer $escaping method of escaping to use */ function out($string, $escaping = ESC_HTML) { + if(is_null($string)) return ''; switch($escaping) { case ESC_HTML: echo htmlspecialchars($string); @@ -155,7 +156,7 @@ function outurl($url) { * @return string HTML-escaped string */ function hesc($string) { - return htmlspecialchars($string); + return htmlspecialchars($string ?? ''); } function english_list($array) {