Make WordPress Core

Ticket #30130: 30130.2.diff

File 30130.2.diff, 1.9 KB (added by zodiac1978, 8 years ago)
  • wp-includes/default-filters.php

     
    9191        add_filter( $filter, 'balanceTags', 50 );
    9292}
    9393
     94// Normalize to NFC
     95foreach ( array( 'sanitize_email', 'sanitize_file_name', 'sanitize_html_class', 'sanitize_key', 'sanitize_meta', 'sanitize_mime_type', 'sanitize_option', 'sanitize_sql_orderby', 'sanitize_text_field', 'sanitize_title', 'sanitize_title_for_query', 'sanitize_title_with_dashes', 'sanitize_user', 'content_save_pre', 'excerpt_save_pre', 'comment_save_pre', 'title_save_pre' ) as $filter ) {
     96        add_filter( $filter, 'normalize_to_nfc' );
     97}
     98
    9499// Format strings for display.
    95100foreach ( array( 'comment_author', 'term_name', 'link_name', 'link_description', 'link_notes', 'bloginfo', 'wp_title', 'widget_title' ) as $filter ) {
    96101        add_filter( $filter, 'wptexturize'   );
     
    262267add_action( 'atom_head', 'atom_site_icon' );
    263268add_action( 'rss2_head', 'rss2_site_icon' );
    264269
    265 
    266270// WP Cron
    267271if ( !defined( 'DOING_CRON' ) )
    268272        add_action( 'init', 'wp_cron' );
  • wp-includes/formatting.php

     
    47934793        }
    47944794        return $short_url;
    47954795}
     4796
     4797/**
     4798 * Normalize text, if necessary and possible
     4799 * See: http://www.w3.org/International/docs/charmod-norm/#choice-of-normalization-form
     4800 *
     4801 * @since 4.6.0
     4802 *
     4803 * @param string $content Content to normalize
     4804 * @return string
     4805*/
     4806function normalize_to_nfc( $content ) {
     4807        if ( function_exists( 'normalizer_normalize' ) ) {
     4808                if ( ! normalizer_is_normalized( $content, Normalizer::FORM_C ) ) {
     4809                        $content = normalizer_normalize( $content, Normalizer::FORM_C );
     4810                }
     4811        }
     4812        return $content;
     4813}
     4814 No newline at end of file