Ensure we have a charset before calling mb_internal_encoding(), avoiding an unnecessary (if suppressed) warning. props dfavor. fixes #23093.

git-svn-id: http://core.svn.wordpress.org/trunk@23373 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin 2013-02-02 02:01:29 +00:00
parent 91e3f2b866
commit 2cb5fccd5c
1 changed files with 2 additions and 1 deletions

View File

@ -514,7 +514,8 @@ function wp_get_active_and_valid_plugins() {
*/
function wp_set_internal_encoding() {
if ( function_exists( 'mb_internal_encoding' ) ) {
if ( !@mb_internal_encoding( get_option( 'blog_charset' ) ) )
$charset = get_option( 'blog_charset' );
if ( ! $charset || ! @mb_internal_encoding( $charset ) )
mb_internal_encoding( 'UTF-8' );
}
}