diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php index 83a09ae8fa..4d834550f5 100644 --- a/wp-includes/formatting.php +++ b/wp-includes/formatting.php @@ -688,24 +688,7 @@ function _wp_specialchars( $string, $quote_style = ENT_NOQUOTES, $charset = fals $quote_style = ENT_NOQUOTES; } - // Handle double encoding ourselves - if ( $double_encode ) { - $string = @htmlspecialchars( $string, $quote_style, $charset ); - } else { - // Decode & into & - $string = wp_specialchars_decode( $string, $_quote_style ); - - // Guarantee every &entity; is valid or re-encode the & - $string = wp_kses_normalize_entities( $string ); - - // Now re-encode everything except &entity; - $string = preg_split( '/(&#?x?[0-9a-z]+;)/i', $string, -1, PREG_SPLIT_DELIM_CAPTURE ); - - for ( $i = 0, $c = count( $string ); $i < $c; $i += 2 ) { - $string[$i] = @htmlspecialchars( $string[$i], $quote_style, $charset ); - } - $string = implode( '', $string ); - } + $string = @htmlspecialchars( $string, $quote_style, $charset, $double_encode ); // Backwards compatibility if ( 'single' === $_quote_style ) diff --git a/wp-includes/version.php b/wp-includes/version.php index 4da98b46dc..9f20cb58cc 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.3-alpha-32849'; +$wp_version = '4.3-alpha-32850'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.