From c6a0fad36ef6509893a265e2621c04fe36693868 Mon Sep 17 00:00:00 2001 From: CaMer0n Date: Sun, 10 Oct 2010 22:08:57 +0000 Subject: [PATCH] Bugfix, but still needs more work --- e107_admin/image.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/e107_admin/image.php b/e107_admin/image.php index 64dba7c12..ae753de05 100644 --- a/e107_admin/image.php +++ b/e107_admin/image.php @@ -386,8 +386,8 @@ class media_admin_ui extends e_admin_ui $fl = e107::getFile(); $mes = e107::getMessage(); - - if(vartrue($_POST['file_userfile'])) + + if(vartrue($_FILES['file_userfile'])) { $pref['upload_storagetype'] = "1"; require_once(e_HANDLER."upload_handler.php"); //TODO - still not a class! @@ -484,7 +484,7 @@ class media_admin_ui extends e_admin_ui if(!vartrue($this->mimePaths[$pmime])) { - $mes->add("Couldn't detected mime-type($type). Upload failed.", E_MESSAGE_ERROR); + $mes->add("Couldn't detect mime-type($mime). Upload failed.", E_MESSAGE_ERROR); return FALSE; } @@ -594,7 +594,15 @@ class media_admin_ui extends e_admin_ui foreach($_POST['batch_selected'] as $file) { $oldpath = "temp/".$file; + $f = $fl->get_file_info(e_MEDIA.$oldpath); + + if(!$f['mime']) + { + $mes->add("Couldn't get file info from : ".$oldpath, E_MESSAGE_ERROR); + } + + $newpath = $this->getPath($f['mime']).'/'.$file; $f['fname'] = $file;