In `sanitize_file_name()`, replace a UTF-8-encoded Unicode representation of a non-breaking space (`\u00a0` / `\xc2\xa`) with an old-fashioned space: ` `.
Fixes #27281. git-svn-id: https://develop.svn.wordpress.org/trunk@27617 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
baa630ce3a
commit
bc2512f8cc
|
@ -888,6 +888,7 @@ function sanitize_file_name( $filename ) {
|
|||
* @param string $filename_raw Filename as it was passed into sanitize_file_name().
|
||||
*/
|
||||
$special_chars = apply_filters( 'sanitize_file_name_chars', $special_chars, $filename_raw );
|
||||
$filename = preg_replace( "#\x{00a0}#siu", ' ', $filename );
|
||||
$filename = str_replace($special_chars, '', $filename);
|
||||
$filename = preg_replace('/[\s-]+/', '-', $filename);
|
||||
$filename = trim($filename, '.-_');
|
||||
|
|
Loading…
Reference in New Issue