File type matching should be case-insensitive.

git-svn-id: http://svn.automattic.com/wordpress/trunk@1060 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
saxmatt 2004-04-12 17:25:59 +00:00
parent 8b076eb5ee
commit 28b7da1c4f

View File

@ -9,7 +9,7 @@ if ($user_level == 0) //Checks to see if user has logged in
if (!get_settings('use_fileupload')) //Checks if file upload is enabled in the config
die ("The admin disabled this function");
$allowed_types = explode(' ', trim(get_settings('fileupload_allowedtypes')));
$allowed_types = explode(' ', trim(strtolower(get_settings('fileupload_allowedtypes'))));
if ($HTTP_POST_VARS['submit']) {
$action = 'upload';
@ -89,7 +89,7 @@ case 'upload':
$imgdesc = str_replace('"', '"', $HTTP_POST_VARS['imgdesc']);
$imgtype = explode(".",$img1_name);
$imgtype = $imgtype[count($imgtype)-1];
$imgtype = strtolower($imgtype[count($imgtype)-1]);
if (in_array($imgtype, $allowed_types) == false) {
die("File $img1_name of type $imgtype is not allowed.");