From efebecfe849b2d4af21f87c3c39dfa0b3747d69b Mon Sep 17 00:00:00 2001 From: xiaomlove <1939737565@qq.com> Date: Mon, 20 Jan 2025 22:12:40 +0800 Subject: [PATCH] format_comment() empty return --- include/functions.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/functions.php b/include/functions.php index 77329b5c..939a59e3 100644 --- a/include/functions.php +++ b/include/functions.php @@ -314,13 +314,16 @@ function format_comment($text, $strip_html = true, $xssclean = false, $newtab = global $lang_functions; global $CURUSER, $SITENAME, $BASEURL; global $tempCode, $tempCodeCount; + if ($text == '') { + return ""; + } $enableattach_attachment = get_setting('attachment.enableattach'); $tempCode = array(); $tempCodeCount = 0; $imageresizer = $imageresizer ? 1 : 0; $s = $text; - if ($strip_html && !is_null($s)) { + if ($strip_html) { $s = htmlspecialchars($s); }