From 072cccd0e4aad0b5be80b4f4a62dd6dfec7c2b2d Mon Sep 17 00:00:00 2001 From: Peter Westwood Date: Wed, 13 Mar 2013 15:24:38 +0000 Subject: [PATCH] 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 --- wp-includes/formatting.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php index b8b51fb105..0052bcc8da 100644 --- a/wp-includes/formatting.php +++ b/wp-includes/formatting.php @@ -2523,7 +2523,7 @@ function wp_richedit_pre($text) { $output = convert_chars($text); $output = wpautop($output); - $output = htmlspecialchars($output, ENT_NOQUOTES); + $output = htmlspecialchars($output, ENT_NOQUOTES, get_option( 'blog_charset' ) ); return apply_filters('richedit_pre', $output); } @@ -2541,7 +2541,7 @@ function wp_richedit_pre($text) { */ function wp_htmledit_pre($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); } @@ -2728,7 +2728,7 @@ function esc_attr( $text ) { * @return string */ 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 ); }