WordPress.org

Make WordPress Core

Ticket #10797: slug-curlyquotes-dashes.patch

File slug-curlyquotes-dashes.patch, 600 bytes (added by alxndr, 11 years ago)

patch to sanitize_title_with_dashes() in formatting.php, replaces curly single- and double- quotes and en- and em-dashes with empty string

  • .php

    old new  
    680680 */
    681681function sanitize_title_with_dashes($title) {
    682682       $title = strip_tags($title);
     683       // strip curly quotes and em/en dashes
     684       $title = preg_replace('/\xe2\x80\x93|\xe2\x80\x94|\xe2\x80\x98|\xe2\x80\x99|\xe2\x80\x9c|\xe2\x80\x9d/','',$title);
    683685       // Preserve escaped octets.
    684686       $title = preg_replace('|%([a-fA-F0-9][a-fA-F0-9])|', '---$1---', $title);
    685687       // Remove percent signs that are not part of an octet.