More name cleanups

git-svn-id: https://develop.svn.wordpress.org/trunk@1864 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Matt Mullenweg 2004-11-18 23:55:08 +00:00
parent a0537e71c7
commit 4ef178d2e0
1 changed files with 9 additions and 14 deletions

View File

@ -77,24 +77,19 @@ case '':
break;
case 'upload':
//Makes sure they choose a file
//print_r($_FILES);
//die();
$imgalt = basename( (isset($_POST['imgalt'])) ? $_POST['imgalt'] : '' );
$img1_name = (strlen($imgalt)) ? $imgalt : basename( $_FILES['img1']['name'] );
$img1_name = preg_replace('/[^a-z0-9.]/i', '', $img1_name);
$img1_type = (strlen($imgalt)) ? $_POST['img1_type'] : $_FILES['img1']['type'];
$imgdesc = htmlentities2($imgdesc);
$pi = pathinfo($img1_name);
$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));
}
if (strlen($imgalt)) {
$pathtofile = get_settings('fileupload_realpath')."/".$imgalt;