Make WordPress Core


Ignore:
Timestamp:
03/13/2013 03:24:38 PM (12 years ago)
Author:
westi
Message:

Formatting: Pass the blog charset to htmlspecialchars so that we don't eat non-UTF8 strings in PHP 5.4

Fixes #23688

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/formatting.php

    r23618 r23685  
    25242524    $output = convert_chars($text);
    25252525    $output = wpautop($output);
    2526     $output = htmlspecialchars($output, ENT_NOQUOTES);
     2526    $output = htmlspecialchars($output, ENT_NOQUOTES, get_option( 'blog_charset' ) );
    25272527
    25282528    return apply_filters('richedit_pre', $output);
     
    25422542function wp_htmledit_pre($output) {
    25432543    if ( !empty($output) )
    2544         $output = htmlspecialchars($output, ENT_NOQUOTES); // convert only < > &
     2544        $output = htmlspecialchars($output, ENT_NOQUOTES, get_option( 'blog_charset' ) ); // convert only < > &
    25452545
    25462546    return apply_filters('htmledit_pre', $output);
     
    27292729 */
    27302730function esc_textarea( $text ) {
    2731     $safe_text = htmlspecialchars( $text, ENT_QUOTES );
     2731    $safe_text = htmlspecialchars( $text, ENT_QUOTES, get_option( 'blog_charset' ) );
    27322732    return apply_filters( 'esc_textarea', $safe_text, $text );
    27332733}
Note: See TracChangeset for help on using the changeset viewer.