From 6c2c21ab442f2607b00a4a3e5f9efe9d7a7942a8 Mon Sep 17 00:00:00 2001 From: Damien Regad Date: Thu, 4 Apr 2024 19:08:05 +0200 Subject: [PATCH] Fix handling of hex-encoded character references This is necessary when Markdown processing is switched off. Fixes #34393 Backported from master branch (cherry picked from commit 100427709e55e5d4da11e1dbb8d6816418b64646) --- core/string_api.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/string_api.php b/core/string_api.php index 3b90904f3c..c742d8e15a 100644 --- a/core/string_api.php +++ b/core/string_api.php @@ -901,7 +901,7 @@ function string_html_specialchars( $p_string ) { # achumakov: @ added to avoid warning output in unsupported codepages # e.g. 8859-2, windows-1257, Korean, which are treated as 8859-1. # This is VERY important for Eastern European, Baltic and Korean languages - return preg_replace( '/&(#[0-9]+|[a-z]+);/i', '&$1;', @htmlspecialchars( $p_string, ENT_COMPAT, 'utf-8' ) ); + return preg_replace( '/&(#x?[0-9]+|[a-z]+);/i', '&$1;', @htmlspecialchars( $p_string, ENT_COMPAT, 'utf-8' ) ); } /**