diff --git a/src/wp-includes/formatting.php b/src/wp-includes/formatting.php index 919336df57..00d730b461 100644 --- a/src/wp-includes/formatting.php +++ b/src/wp-includes/formatting.php @@ -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, '.-_');