WordPress.org

Make WordPress Core

Ticket #23688: 23688.diff

File 23688.diff, 1.6 KB (added by ryan, 5 years ago)
  • wp-includes/default-filters.php

     
    179179// Misc filters
    180180add_filter( 'option_ping_sites',        'privacy_ping_filter'                 );
    181181add_filter( 'option_blog_charset',      '_wp_specialchars'                    ); // IMPORTANT: This must not be wp_specialchars() or esc_html() or it'll cause an infinite loop
     182add_filter( 'option_blog_charset',      '_canonical_charset'                  );
    182183add_filter( 'option_home',              '_config_wp_home'                     );
    183184add_filter( 'option_siteurl',           '_config_wp_siteurl'                  );
    184185add_filter( 'tiny_mce_before_init',     '_mce_set_direction'                  );
  • wp-includes/functions.php

     
    39983998                return;
    39993999        return sprintf( '<%1$s[^<]*(?:>[\s\S]*<\/%1$s>|\s*\/>)', tag_escape( $tag ) );
    40004000}
     4001
     4002/**
     4003 * Return a canonical form of the provided charset appropriate for passing to PHP
     4004 * functions such as htmlspecialchars() and charset html attributes.
     4005 *
     4006 * @since 3.6.0
     4007 * @param string A charset name
     4008 * @return string The canonical form of the charset
     4009 */
     4010function _canonical_charset( $charset ) {
     4011        if ( in_array( $charset, array( 'utf8', 'utf-8', 'UTF8' ) ) )
     4012                return 'UTF-8';
     4013
     4014        return $charset;
     4015}
     4016 No newline at end of file