From 569c17df7fedb97262dca9dfed042d37a11f891d Mon Sep 17 00:00:00 2001 From: ryan Date: Sun, 22 May 2011 23:17:09 +0000 Subject: [PATCH] Properly anchor mime preg. git-svn-id: http://svn.automattic.com/wordpress/trunk@17990 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- 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 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;