WordPress.org

Make WordPress Core

Ticket #30130: 30130.1.diff

File 30130.1.diff, 1.7 KB (added by zodiac1978, 4 years ago)

Fixed tabs vs. spaces

  • wp-includes/default-filters.php

     
    9191        add_filter( $filter, 'balanceTags', 50 );
    9292}
    9393
     94// Normalize to NFC
     95foreach ( array( 'content_save_pre', 'excerpt_save_pre', 'comment_save_pre', 'pre_comment_content', '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

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