更新了body字段更新时的但双引号处理

This commit is contained in:
Li Jianxuan 2011-12-26 03:20:07 +00:00
parent 08e0da7935
commit 7d71b3e351
1 changed files with 2 additions and 2 deletions

View File

@ -362,7 +362,7 @@ class Admin_NewsController extends Zend_Controller_Action
'source' => $this->replacehtml($source), 'source' => $this->replacehtml($source),
'typeid' => $typeid, 'typeid' => $typeid,
'pub' => $pub, 'pub' => $pub,
'body' => $body 'body' => $this->db->quote($body)
); );
@ -384,7 +384,7 @@ class Admin_NewsController extends Zend_Controller_Action
$sth = $this->db->prepare($sql); $sth = $this->db->prepare($sql);
if($sth->execute()) if($sth->execute())
{ {
$sql = "UPDATE news_archivesaddon SET body='".$date['body']."' WHERE id='$id'"; $sql = "UPDATE news_archivesaddon SET body=".$date['body']." WHERE id='$id'";
if($this->db->exec($sql)>0) if($this->db->exec($sql)>0)
{ {
echo '<div class="box box-success">发布成功!</div><script> echo '<div class="box box-success">发布成功!</div><script>