From e0ead8a31be8579700057b4329cf9aa391df3e52 Mon Sep 17 00:00:00 2001 From: wlx Date: Mon, 21 May 2012 12:16:09 +0000 Subject: [PATCH] =?UTF-8?q?fix=20#341,=20=E5=8F=AF=E4=BB=A5=E4=B8=8A?= =?UTF-8?q?=E4=BC=A0=E5=8D=95=E7=8B=AC=E7=9A=84=E9=99=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/controllers/DataController.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/application/admin/controllers/DataController.php b/application/admin/controllers/DataController.php index f52df5bc..0548b281 100755 --- a/application/admin/controllers/DataController.php +++ b/application/admin/controllers/DataController.php @@ -1436,8 +1436,8 @@ class Admin_DataController extends Zend_Controller_Action exit(); } - $files=new files(); - $msg = $files -> upload($this->view->config->upload,$_FILES['Filedata'],'md'); + $files=new files(); + $msg = $files -> upload($this->view->config->upload,$_FILES['Filedata'],empty($uuid)?'file':'md'); if(empty($msg['error'])) { @@ -1456,7 +1456,7 @@ class Admin_DataController extends Zend_Controller_Action $msg['attid'] = $attid = $att['id']; $sql = "insert into mdattach (uuid,id) values ('$uuid','$attid')"; - if($this->db->exec($sql)) + if(empty($uuid) || $this->db->exec($sql)) { $msg['html'] = $realname.'['. round($filesize/1024,2) .' kb]
'; echo Zend_Json::encode($msg);