diff --git a/server/controllers/ticket/comment.php b/server/controllers/ticket/comment.php index 5b250812..7be2b248 100755 --- a/server/controllers/ticket/comment.php +++ b/server/controllers/ticket/comment.php @@ -141,7 +141,7 @@ class CommentController extends Controller { $email = $recipient['email']; $name = $recipient['name']; - $isStaff = $recipient['staff']; + $isStaff = array_key_exists('staff', $recipient) && $recipient['staff']; $url = Setting::getSetting('url')->getValue(); diff --git a/server/models/Ticket.php b/server/models/Ticket.php index 702afeec..f407ab02 100755 --- a/server/models/Ticket.php +++ b/server/models/Ticket.php @@ -188,7 +188,7 @@ class Ticket extends DataStore { if(!Controller::isStaffLogged() && $ticketEvent->private) { continue; } - + $events[] = $event; } @@ -200,12 +200,13 @@ class Ticket extends DataStore { } public function isAuthor($user) { + if(!$user->isNull()) return false; $ticketAuthor = $this->authorToArray(); if(is_string($user)) return $user == $ticketAuthor['email']; return $user->id == $ticketAuthor['id'] && ($user instanceof Staff) == $ticketAuthor['staff']; } public function isOwner($user) { - return $this->owner && $user->id == $this->owner->id && ($user instanceof Staff); + return !$user->isNull() && $this->owner && $user->id == $this->owner->id && ($user instanceof Staff); } }