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
1 changed files with 2 additions and 2 deletions

View File

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