mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 01:27:36 +01:00
cleanup filenames
git-svn-id: http://svn.automattic.com/wordpress/trunk@1863 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
8615d77651
commit
10d0af0fb2
@ -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));
|
||||
|
Loading…
Reference in New Issue
Block a user