WordPress.org

Make WordPress Core

Ticket #23688: htmlspecialchars-with-charset.diff

File htmlspecialchars-with-charset.diff, 1.1 KB (added by westi, 5 years ago)

Pass the blog_charset to htmlspecialchars

  • wp-includes/formatting.php

     
    24962496
    24972497        $output = convert_chars($text);
    24982498        $output = wpautop($output);
    2499         $output = htmlspecialchars($output, ENT_NOQUOTES);
     2499        $output = htmlspecialchars($output, ENT_NOQUOTES, get_option( 'blog_charset' ) );
    25002500
    25012501        return apply_filters('richedit_pre', $output);
    25022502}
     
    25142514 */
    25152515function wp_htmledit_pre($output) {
    25162516        if ( !empty($output) )
    2517                 $output = htmlspecialchars($output, ENT_NOQUOTES); // convert only < > &
     2517                $output = htmlspecialchars($output, ENT_NOQUOTES, get_option( 'blog_charset' ) ); // convert only < > &
    25182518
    25192519        return apply_filters('htmledit_pre', $output);
    25202520}
     
    27022702 * @return string
    27032703 */
    27042704function esc_textarea( $text ) {
    2705         $safe_text = htmlspecialchars( $text, ENT_QUOTES );
     2705        $safe_text = htmlspecialchars( $text, ENT_QUOTES, get_option( 'blog_charset' ) );
    27062706        return apply_filters( 'esc_textarea', $safe_text, $text );
    27072707}
    27082708