Skip to content

Commit

Permalink
Fix handling of hex-encoded character references
Browse files Browse the repository at this point in the history
This is necessary when Markdown processing is switched off.

Fixes #34393

Backported from master branch (cherry picked from commit
1004277)
  • Loading branch information
dregad committed Apr 6, 2024
1 parent bcf62d6 commit 6c2c21a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/string_api.php
Expand Up @@ -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' ) );
}

/**
Expand Down

0 comments on commit 6c2c21a

Please sign in to comment.