diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php index 4d834550f5..ce33351a84 100644 --- a/wp-includes/formatting.php +++ b/wp-includes/formatting.php @@ -688,6 +688,12 @@ function _wp_specialchars( $string, $quote_style = ENT_NOQUOTES, $charset = fals $quote_style = ENT_NOQUOTES; } + if ( ! $double_encode ) { + // Guarantee every &entity; is valid, convert &garbage; into &garbage; + // This is required for PHP < 5.4.0 because ENT_HTML401 flag is unavailable. + $string = wp_kses_normalize_entities( $string ); + } + $string = @htmlspecialchars( $string, $quote_style, $charset, $double_encode ); // Backwards compatibility diff --git a/wp-includes/version.php b/wp-includes/version.php index 9f20cb58cc..54e3e06459 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.3-alpha-32850'; +$wp_version = '4.3-alpha-32851'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.