cleanup filenames

git-svn-id: http://svn.automattic.com/wordpress/trunk@1863 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
mikelittle 2004-11-18 23:30:51 +00:00
parent 8615d77651
commit 10d0af0fb2

View File

@ -89,8 +89,8 @@ case 'upload':
$img1_type = (strlen($imgalt)) ? $_POST['img1_type'] : $_FILES['img1']['type'];
$imgdesc = htmlentities2($imgdesc);
$imgtype = explode(".",$img1_name);
$imgtype = strtolower($imgtype[count($imgtype)-1]);
$pi = pathinfo($img1_name);
$imgtype = strtolower($pi['extension']);
if (in_array($imgtype, $allowed_types) == false) {
die(sprintf(__('File %1$s of type %2$s is not allowed.') , $img1_name, $imgtype));