diff --git a/include/class.faq.php b/include/class.faq.php index 048e9b2779e7afd2ff4a410ae6a36414aaa837f3..8a006041a9c7757e7e29b781a3d38cfa680357df 100644 --- a/include/class.faq.php +++ b/include/class.faq.php @@ -180,9 +180,7 @@ class FAQ { // Inline images (attached to the draft) $this->attachments->deleteInlines(); - if (isset($vars['draft_id']) && $vars['draft_id']) - if ($draft = Draft::lookup($vars['draft_id'])) - $this->attachments->upload($draft->getAttachmentIds(), true); + $this->attachments->upload(Draft::getAttachmentIds($vars['answer'])); $this->reload(); diff --git a/scp/pages.php b/scp/pages.php index 5f3747b5e1c789db43e2db2c3e77bd3e2b39102c..7e7ff4cb24f407efa6317b6661b8730d0e02b0a8 100644 --- a/scp/pages.php +++ b/scp/pages.php @@ -27,11 +27,9 @@ if($_POST) { $_REQUEST['a'] = null; $msg='Page added successfully'; // Attach inline attachments from the editor - if (isset($_POST['draft_id']) - && ($draft = Draft::lookup($_POST['draft_id'])) - && ($page = Page::lookup($pageId))) + if ($page = Page::lookup($pageId)) $page->attachments->upload( - $draft->getAttachmentIds($_POST['response']), true); + Draft::getAttachmentIds($_POST['body']), true); Draft::deleteForNamespace('page'); } elseif(!$errors['err']) $errors['err'] = 'Unable to add page. Try again!'; @@ -43,12 +41,10 @@ if($_POST) { $msg='Page updated successfully'; $_REQUEST['a']=null; //Go back to view // Attach inline attachments from the editor - if (isset($_POST['draft_id']) - && ($draft = Draft::lookup($_POST['draft_id']))) { - $page->attachments->deleteInlines(); - $page->attachments->upload( - $draft->getAttachmentIds($_POST['response']), - true); + $page->attachments->deleteInlines(); + $page->attachments->upload( + Draft::getAttachmentIds($_POST['body']), + true); } Draft::deleteForNamespace('page.'.$page->getId()); } elseif(!$errors['err'])