From 92b4ffafc336da93f5ecfdef0f76632c33d3139b Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Sun, 22 May 2011 23:17:09 +0000 Subject: [PATCH] Properly anchor mime preg. git-svn-id: https://develop.svn.wordpress.org/trunk@17990 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/formatting.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php index 9c8bd2dde4..28ad0103bf 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;