Changeset 18705 for trunk/wp-includes/formatting.php
- Timestamp:
- 09/18/2011 07:53:59 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/formatting.php
r18633 r18705 804 804 805 805 /** 806 * Sanitizes title, replacing whitespace with dashes.806 * Sanitizes title, replacing whitespace and a few other characters with dashes. 807 807 * 808 808 * Limits the output to alphanumeric characters, underscore (_) and dash (-). … … 812 812 * 813 813 * @param string $title The title to be sanitized. 814 * @param string $raw_title Optional. Not used. 815 * @param string $context Optional. The operation for which the string is sanitized. 814 816 * @return string The sanitized title. 815 817 */ 816 function sanitize_title_with_dashes($title ) {818 function sanitize_title_with_dashes($title, $raw_title = '', $context = 'display') { 817 819 $title = strip_tags($title); 818 820 // Preserve escaped octets. … … 833 835 $title = preg_replace('/&.+?;/', '', $title); // kill entities 834 836 $title = str_replace('.', '-', $title); 837 838 if ( 'save' == $context ) { 839 // nbsp, ndash and mdash 840 $title = str_replace( array( '%c2%a0', '%e2%80%93', '%e2%80%94' ), '-', $title ); 841 // iexcl and iquest 842 $title = str_replace( array( '%c2%a1', '%c2%bf' ), '', $title ); 843 // angle quotes 844 $title = str_replace( array( '%c2%ab', '%c2%bb', '%e2%80%b9', '%e2%80%ba' ), '', $title ); 845 // curly quotes 846 $title = str_replace( array( '%e2%80%98', '%e2%80%99', '%e2%80%9c', '%e2%80%9d' ), '', $title ); 847 // copy, reg, deg, hellip and trade 848 $title = str_replace( array( '%c2%a9', '%c2%ae', '%c2%b0', '%e2%80%a6', '%e2%84%a2' ), '', $title ); 849 } 850 835 851 $title = preg_replace('/[^%a-z0-9 _-]/', '', $title); 836 852 $title = preg_replace('/\s+/', '-', $title);
Note: See TracChangeset
for help on using the changeset viewer.