Ticket #26094: 26094.patch
| File 26094.patch, 1.1 KB (added by , 12 years ago) |
|---|
-
src/wp-includes/formatting.php
844 844 $special_chars = array("?", "[", "]", "/", "\\", "=", "<", ">", ":", ";", ",", "'", "\"", "&", "$", "#", "*", "(", ")", "|", "~", "`", "!", "{", "}", chr(0)); 845 845 $special_chars = apply_filters('sanitize_file_name_chars', $special_chars, $filename_raw); 846 846 $filename = str_replace($special_chars, '', $filename); 847 $filename = preg_replace('/[\ s-]+/', '-', $filename);847 $filename = preg_replace('/[\p{Z}\s-]+/u', '-', $filename); // Match all UTF-8 whitespace 848 848 $filename = trim($filename, '.-_'); 849 849 850 850 // Split the filename into a base and extension[s] … … 864 864 foreach ( (array) $parts as $part) { 865 865 $filename .= '.' . $part; 866 866 867 if ( preg_match("/^[a-zA-Z]{2,5}\d?$/ ", $part) ) {867 if ( preg_match("/^[a-zA-Z]{2,5}\d?$/u", $part) ) { 868 868 $allowed = false; 869 869 foreach ( $mimes as $ext_preg => $mime_match ) { 870 870 $ext_preg = '!^(' . $ext_preg . ')$!i';