From 4a9b5af04dd251f4b8501e8e0c97c29c647dc7ab Mon Sep 17 00:00:00 2001 From: wlx Date: Thu, 3 Mar 2011 03:43:24 +0000 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=AD=97=E7=AC=A6=E8=BD=AC?= =?UTF-8?q?=E4=B9=89=E6=8E=A7=E5=88=B6=EF=BC=8C=E5=A2=9E=E5=8A=A0=E8=BF=90?= =?UTF-8?q?=E8=A1=8C=E6=97=B6=E9=97=B4=E6=8E=A7=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/controllers/DataController.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/application/admin/controllers/DataController.php b/application/admin/controllers/DataController.php index ca8f599f..482ccc42 100755 --- a/application/admin/controllers/DataController.php +++ b/application/admin/controllers/DataController.php @@ -648,6 +648,7 @@ class Admin_DataController extends Zend_Controller_Action function datafileimportAction() { if ($this->_request->isPost()) { + set_time_limit(0); $dir = $this->_request->getPost('directory'); if (file_exists($dir.'/dataset.txt')) { @@ -664,8 +665,9 @@ class Admin_DataController extends Zend_Controller_Action $sql="delete from dataset where uuid='".$duuid."'"; //datafile table will auto-delete $this->db->query($sql); - $sql="insert into dataset (path,uuid) values('".$dpath."','".$duuid."')"; - $this->db->query($sql); + //$sql="insert into dataset (path,uuid) values('".$dpath."','".$duuid."')"; + $sql="insert into dataset (path,uuid) values(?,?)"; + $this->db->query($sql,array($dpath,$duuid)); $sql="select id from dataset where uuid='".$duuid."'"; $rs=$this->db->fetchRow($sql); $dsid=$rs["id"]; @@ -686,8 +688,9 @@ class Admin_DataController extends Zend_Controller_Action { $fdepth=substr_count($fpath,"/")+1; //print $fsize." ".$fpath." ".$fdir."
"; - $sql="insert into datafile (dsid,filename,filesize,isdir,depth) values(".$dsid.",'".$fpath."',".$fsize.",".$fdir.",".$fdepth.")"; - $this->db->query($sql); + //$sql="insert into datafile (dsid,filename,filesize,isdir,depth) values(".$dsid.",'".$this->db->escape($fpath)."',".$fsize.",".$fdir.",".$fdepth.")"; + $sql="insert into datafile (dsid,filename,filesize,isdir,depth) values(?,?,?,?,?)"; + $this->db->query($sql,array($dsid,$fpath,$fsize,$fdir,$fdepth)); } } }