Properly anchor mime preg.

git-svn-id: https://develop.svn.wordpress.org/trunk@17990 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2011-05-22 23:17:09 +00:00
parent 6076211cc6
commit 92b4ffafc3

View File

@ -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;