From cae70ddec146184cd92472e2bc673c814af1e619 Mon Sep 17 00:00:00 2001 From: wlx Date: Mon, 3 Dec 2012 03:42:25 +0000 Subject: [PATCH] =?UTF-8?q?fix=20#410,=20=E9=BB=91=E6=B2=B3=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E6=B1=87=E4=BA=A4=E4=B8=AD=E6=B7=BB=E5=8A=A0=E5=85=83?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=94=99=E8=AF=AF=E6=A3=80=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../default/controllers/HeiheController.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/application/default/controllers/HeiheController.php b/application/default/controllers/HeiheController.php index 37601fd4..43f8a30e 100644 --- a/application/default/controllers/HeiheController.php +++ b/application/default/controllers/HeiheController.php @@ -487,7 +487,17 @@ class HeiheController extends DataController return true; }else{ $uuid = $row['uuid']; - } + } + + //检查元数据错误 + $iso=new ISO19115(); + @$iso->loadXML($row['data']); + if ($iso->validate()) + { + $data=array("error"=>"元数据导入过程中发现错误。
".implode("
",$iso->error)); + $this->jsonexit($data); + return true; + } $messages = array(); @@ -566,8 +576,7 @@ class HeiheController extends DataController // 3. 保存数据评审状态 //导入元数据 - $iso=new ISO19115(); - $iso->saveDB($this->db,$row['xml']); + $iso->saveDB($this->db); //进入评审库 $sql="insert into mdstatus (uuid,status,userid) values(?,?,?)"; $this->db->query($sql,array($uuid,0,$u_id));