Revert [32851] and [32850] for now, tl;dr encoding issues.

See #17780.


Built from https://develop.svn.wordpress.org/trunk@33148


git-svn-id: http://core.svn.wordpress.org/trunk@33120 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor 2015-07-09 20:56:24 +00:00
parent 3e292a2426
commit 6cc3a903d7
2 changed files with 18 additions and 7 deletions

View File

@ -751,13 +751,24 @@ function _wp_specialchars( $string, $quote_style = ENT_NOQUOTES, $charset = fals
$quote_style = ENT_NOQUOTES; $quote_style = ENT_NOQUOTES;
} }
if ( ! $double_encode ) { // Handle double encoding ourselves
// Guarantee every &entity; is valid, convert &garbage; into &garbage; if ( $double_encode ) {
// This is required for PHP < 5.4.0 because ENT_HTML401 flag is unavailable. $string = @htmlspecialchars( $string, $quote_style, $charset );
$string = wp_kses_normalize_entities( $string ); } else {
} // Decode &amp; into &
$string = wp_specialchars_decode( $string, $_quote_style );
$string = @htmlspecialchars( $string, $quote_style, $charset, $double_encode ); // 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 );
}
// Backwards compatibility // Backwards compatibility
if ( 'single' === $_quote_style ) if ( 'single' === $_quote_style )

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '4.3-beta2-33147'; $wp_version = '4.3-beta2-33148';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.