diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php index 744eefeb82..69a273eaf1 100644 --- a/wp-includes/formatting.php +++ b/wp-includes/formatting.php @@ -2035,7 +2035,17 @@ function sanitize_file_name( $filename ) { } if ( $utf8_pcre ) { - $filename = preg_replace( "#\x{00a0}#siu", ' ', $filename ); + /** + * Replace all whitespace characters with a basic space (U+0020). + * + * The “Zs” in the pattern selects characters in the `Space_Separator` + * category, which is what Unicode considers space characters. + * + * @see https://www.unicode.org/reports/tr44/#General_Category_Values + * @see https://www.unicode.org/versions/Unicode16.0.0/core-spec/chapter-6/#G17548 + * @see https://www.php.net/manual/en/regexp.reference.unicode.php + */ + $filename = preg_replace( '#\p{Zs}#siu', ' ', $filename ); } /** diff --git a/wp-includes/version.php b/wp-includes/version.php index 637e17c621..b434479a54 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.8.2-alpha-60410'; +$wp_version = '6.8.2-alpha-60411'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.