From 58206ba94522fa85ded807a5c89a63a58eff4fe3 Mon Sep 17 00:00:00 2001
From: Peter Rotich <peter@enhancesoft.com>
Date: Tue, 16 Apr 2019 18:49:49 +0000
Subject: [PATCH] Misc. fixes

---
 include/ajax.tickets.php | 2 +-
 include/class.thread.php | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/ajax.tickets.php b/include/ajax.tickets.php
index 2a176b9b8..be1d0b57e 100644
--- a/include/ajax.tickets.php
+++ b/include/ajax.tickets.php
@@ -1456,7 +1456,7 @@ function refer($tid, $target=null) {
                 && ($f=$iform->getField('duedate'))) {
             $f->configure('max', Misc::db2gmtime($ticket->getEstDueDate()));
         }
-        $vars = array_merge($_SESSION[':form-data'], $vars);
+        $vars = array_merge($_SESSION[':form-data'] ? : array(), $vars);
 
         if ($_POST) {
             Draft::deleteForNamespace(
diff --git a/include/class.thread.php b/include/class.thread.php
index 55be97a10..7aae4f939 100644
--- a/include/class.thread.php
+++ b/include/class.thread.php
@@ -228,7 +228,7 @@ implements Searchable {
 
             foreach ($vars['cid'] as $c) {
               $collab = Collaborator::lookup($c);
-              if(get_class($collab) == 'Collaborator') {
+              if (($collab instanceof Collaborator)) {
                 $collab->setFlag(Collaborator::FLAG_ACTIVE, true);
                 $collab->save();
               }
-- 
GitLab