Properly anchor mime preg.

git-svn-id: http://svn.automattic.com/wordpress/trunk@17990 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2011-05-22 23:17:09 +00:00
parent fad60afa23
commit 569c17df7f
1 changed files with 1 additions and 1 deletions

View File

@ -707,7 +707,7 @@ function sanitize_file_name( $filename ) {
if ( preg_match("/^[a-zA-Z]{2,5}\d?$/", $part) ) { if ( preg_match("/^[a-zA-Z]{2,5}\d?$/", $part) ) {
$allowed = false; $allowed = false;
foreach ( $mimes as $ext_preg => $mime_match ) { foreach ( $mimes as $ext_preg => $mime_match ) {
$ext_preg = '!(^' . $ext_preg . ')$!i'; $ext_preg = '!^(' . $ext_preg . ')$!i';
if ( preg_match( $ext_preg, $part ) ) { if ( preg_match( $ext_preg, $part ) ) {
$allowed = true; $allowed = true;
break; break;