From 217e873e88f595a0ad7fedfeff40b08924e0701d Mon Sep 17 00:00:00 2001 From: discomrade <83621080+discomrade@users.noreply.github.com> Date: Tue, 6 Jul 2021 12:41:16 +0000 Subject: [PATCH] Prevent double-encoding of HTML entities in [code] --- inc/functions.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/inc/functions.php b/inc/functions.php index 3e9fffd0..a0fe0943 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -2196,8 +2196,8 @@ function markup(&$body, $track_cites = false, $op = false) { $code = rtrim(ltrim($code, "\r\n")); - $code = "
".str_replace(array("\n","\t"), array("
","	"), htmlspecialchars($code))."
"; - + $code = "
".str_replace(array("\n","\t"), array("
","	"), htmlspecialchars($code, ENT_COMPAT, "UTF-8", false))."
"; + $body = str_replace("", $code, $body); } }