From db335cdb8f6f91d4d00a3c59080cdb349578daa4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A5=81=E5=AE=81?= Date: Thu, 17 Apr 2014 11:36:15 +0800 Subject: [PATCH] fix #217 --- var/Widget/Contents/Post/Edit.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/var/Widget/Contents/Post/Edit.php b/var/Widget/Contents/Post/Edit.php index 861157a6..c0818211 100644 --- a/var/Widget/Contents/Post/Edit.php +++ b/var/Widget/Contents/Post/Edit.php @@ -154,9 +154,8 @@ class Widget_Contents_Post_Edit extends Widget_Abstract_Contents implements Widg */ protected function attach($cid) { - if ($this->request->attachment && is_array($this->request->attachment)) { - $attachments = $this->request->filter('int')->attachment; - + $attachments = $this->request->getArray('attachment'); + if (!empty($attachments)) { foreach ($attachments as $key => $attachment) { $this->db->query($this->db->update('table.contents')->rows(array('parent' => $cid, 'status' => 'publish', 'order' => $key + 1))->where('cid = ? AND type = ?', $attachment, 'attachment'));