Properly anchor mime preg.
git-svn-id: http://svn.automattic.com/wordpress/trunk@17990 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
fad60afa23
commit
569c17df7f
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue