Make WordPress Core

Ticket #10797: 10797.patch

File 10797.patch, 1.0 KB (added by SergeyBiryukov, 13 years ago)
  • wp-includes/formatting.php

     
    807807}
    808808
    809809/**
    810  * Sanitizes title, replacing whitespace with dashes.
     810 * Sanitizes title, replacing whitespace and a few other characters with dashes.
    811811 *
    812812 * Limits the output to alphanumeric characters, underscore (_) and dash (-).
    813813 * Whitespace becomes a dash.
     
    836836        $title = strtolower($title);
    837837        $title = preg_replace('/&.+?;/', '', $title); // kill entities
    838838        $title = str_replace('.', '-', $title);
     839
     840        // ndash and mdash
     841        $title = str_replace( array( '%e2%80%93', '%e2%80%94' ), '-', $title );
     842        // curly quotes and hellip
     843        $title = str_replace( array( '%e2%80%9c', '%e2%80%9d', '%e2%80%98', '%e2%80%99', '%e2%80%a6' ), '', $title );
     844
    839845        $title = preg_replace('/[^%a-z0-9 _-]/', '', $title);
    840846        $title = preg_replace('/\s+/', '-', $title);
    841847        $title = preg_replace('|-+|', '-', $title);