WordPress.org

Make WordPress Core

Ticket #10797: 10797.2.patch

File 10797.2.patch, 1019 bytes (added by SergeyBiryukov, 7 years ago)
  • wp-includes/formatting.php

     
    787787function sanitize_title($title, $fallback_title = '', $context = 'save') {
    788788        $raw_title = $title;
    789789
    790         if ( 'save' == $context )
     790        if ( 'save' == $context ) {
    791791                $title = remove_accents($title);
    792792
     793                $special_chars = array(
     794                        chr(0xE2).chr(0x80).chr(0x93) => '-', chr(0xE2).chr(0x80).chr(0x94) => '-', // ndash and mdash
     795                        chr(0xE2).chr(0x80).chr(0x9C) => '',  chr(0xE2).chr(0x80).chr(0x9D) => '',  // double curly quotes
     796                        chr(0xE2).chr(0x80).chr(0x98) => '',  chr(0xE2).chr(0x80).chr(0x99) => '',  // single curly quotes
     797                        chr(0xE2).chr(0x80).chr(0xA6) => ''                                         // hellip
     798                );
     799
     800                $title = strtr( $title, $special_chars );
     801        }
     802
    793803        $title = apply_filters('sanitize_title', $title, $raw_title, $context);
    794804
    795805        if ( '' === $title || false === $title )