From 4ec1602ff3f6882ea0eeaa3c324dbc8b6a26f6f6 Mon Sep 17 00:00:00 2001
From: Jared Hancock <jared@osticket.com>
Date: Fri, 17 Jul 2015 09:57:17 -0500
Subject: [PATCH] draft: Fix crash attaching some images

---
 include/ajax.draft.php | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/include/ajax.draft.php b/include/ajax.draft.php
index 1b7b30d5a..c18dca63d 100644
--- a/include/ajax.draft.php
+++ b/include/ajax.draft.php
@@ -98,12 +98,7 @@ class DraftAjaxAPI extends AjaxController {
             if ($file[0]['name'] == 'blob')
                 $file[0]['name'] = 'screenshot-'.Misc::randCode(4);
 
-            if (isset($file[0]['tmp_name'])) {
-              $ids = $draft->attachments->upload($file);
-            }
-            else {
-              $ids = $draft->attachments->save($file[0]);
-            }
+            $ids = $draft->attachments->upload($file);
 
             if (!$ids) {
                 if ($file[0]['error']) {
-- 
GitLab