Formatting: Pass the blog charset to htmlspecialchars so that we don't eat non-UTF8 strings in PHP 5.4
Fixes #23688 git-svn-id: http://core.svn.wordpress.org/trunk@23685 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
5b7cee2834
commit
072cccd0e4
|
@ -2523,7 +2523,7 @@ function wp_richedit_pre($text) {
|
||||||
|
|
||||||
$output = convert_chars($text);
|
$output = convert_chars($text);
|
||||||
$output = wpautop($output);
|
$output = wpautop($output);
|
||||||
$output = htmlspecialchars($output, ENT_NOQUOTES);
|
$output = htmlspecialchars($output, ENT_NOQUOTES, get_option( 'blog_charset' ) );
|
||||||
|
|
||||||
return apply_filters('richedit_pre', $output);
|
return apply_filters('richedit_pre', $output);
|
||||||
}
|
}
|
||||||
|
@ -2541,7 +2541,7 @@ function wp_richedit_pre($text) {
|
||||||
*/
|
*/
|
||||||
function wp_htmledit_pre($output) {
|
function wp_htmledit_pre($output) {
|
||||||
if ( !empty($output) )
|
if ( !empty($output) )
|
||||||
$output = htmlspecialchars($output, ENT_NOQUOTES); // convert only < > &
|
$output = htmlspecialchars($output, ENT_NOQUOTES, get_option( 'blog_charset' ) ); // convert only < > &
|
||||||
|
|
||||||
return apply_filters('htmledit_pre', $output);
|
return apply_filters('htmledit_pre', $output);
|
||||||
}
|
}
|
||||||
|
@ -2728,7 +2728,7 @@ function esc_attr( $text ) {
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function esc_textarea( $text ) {
|
function esc_textarea( $text ) {
|
||||||
$safe_text = htmlspecialchars( $text, ENT_QUOTES );
|
$safe_text = htmlspecialchars( $text, ENT_QUOTES, get_option( 'blog_charset' ) );
|
||||||
return apply_filters( 'esc_textarea', $safe_text, $text );
|
return apply_filters( 'esc_textarea', $safe_text, $text );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue