From cba4e66eb1becb98b6cd82eeee4831b8b4616177 Mon Sep 17 00:00:00 2001 From: colemanw Date: Fri, 4 Aug 2023 10:35:40 -0400 Subject: [PATCH] Smarty - Fix e-notice in modifier.escape.php --- Smarty/plugins/modifier.escape.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Smarty/plugins/modifier.escape.php b/Smarty/plugins/modifier.escape.php index a2f52b232..aa7b4b9d0 100644 --- a/Smarty/plugins/modifier.escape.php +++ b/Smarty/plugins/modifier.escape.php @@ -21,6 +21,11 @@ */ function smarty_modifier_escape($string, $esc_type = 'html', $char_set = 'ISO-8859-1') { + // Early return for null, '', or '0', none of which need to be escaped and null will cause e-notices. + if (empty($string)) { + return (string) $string; + } + switch ($esc_type) { case 'html': return htmlspecialchars($string, ENT_QUOTES, $char_set);