Ensure that wp_specialchars captures all pre-encoded entities correctly when preventing double encoding. Fixes #9821.
git-svn-id: http://svn.automattic.com/wordpress/trunk@11338 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
b0ae00fc0c
commit
378aaa973e
|
@ -244,7 +244,7 @@ function wp_specialchars( $string, $quote_style = ENT_NOQUOTES, $charset = false
|
|||
// Handle double encoding ourselves
|
||||
if ( !$double_encode ) {
|
||||
$string = wp_specialchars_decode( $string, $_quote_style );
|
||||
$string = preg_replace( '/&(#?x?[0-9]+|[a-z]+);/i', '|wp_entity|$1|/wp_entity|', $string );
|
||||
$string = preg_replace( '/&(#?x?[0-9a-z]+);/i', '|wp_entity|$1|/wp_entity|', $string );
|
||||
}
|
||||
|
||||
$string = @htmlspecialchars( $string, $quote_style, $charset );
|
||||
|
|
Loading…
Reference in New Issue