diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php index 9c8bd2dde..28ad0103b 100644 --- a/wp-includes/formatting.php +++ b/wp-includes/formatting.php @@ -707,7 +707,7 @@ function sanitize_file_name( $filename ) { if ( preg_match("/^[a-zA-Z]{2,5}\d?$/", $part) ) { $allowed = false; foreach ( $mimes as $ext_preg => $mime_match ) { - $ext_preg = '!(^' . $ext_preg . ')$!i'; + $ext_preg = '!^(' . $ext_preg . ')$!i'; if ( preg_match( $ext_preg, $part ) ) { $allowed = true; break;