diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php index 72fcb4e554..b6bf168de2 100644 --- a/wp-includes/formatting.php +++ b/wp-includes/formatting.php @@ -2195,20 +2195,13 @@ function sanitize_file_name( $filename ) { $special_chars = array( '?', '[', ']', '/', '\\', '=', '<', '>', ':', ';', ',', "'", '"', '&', '$', '#', '*', '(', ')', '|', '~', '`', '!', '{', '}', '%', '+', '’', '«', '»', '”', '“', chr( 0 ) ); - // Check for support for utf8 in the installed PCRE library once and store the result in a static. - static $utf8_pcre = null; - if ( ! isset( $utf8_pcre ) ) { - // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged - $utf8_pcre = @preg_match( '/^./u', 'a' ); - } - if ( ! wp_is_valid_utf8( $filename ) ) { $_ext = pathinfo( $filename, PATHINFO_EXTENSION ); $_name = pathinfo( $filename, PATHINFO_FILENAME ); $filename = sanitize_title_with_dashes( $_name ) . '.' . $_ext; } - if ( $utf8_pcre ) { + if ( _wp_can_use_pcre_u() ) { /** * Replace all whitespace characters with a basic space (U+0020). * diff --git a/wp-includes/version.php b/wp-includes/version.php index 5489863251..ce229cb071 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.9-alpha-60694'; +$wp_version = '6.9-alpha-60695'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.