From 668644c5d56fc12356575355851edcdef9f14fcd Mon Sep 17 00:00:00 2001 From: Christoph Haas Date: Mon, 5 Dec 2016 20:37:35 +0100 Subject: [PATCH] Fix empty check --- php/module.calendar.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/php/module.calendar.php b/php/module.calendar.php index 4325998..b6c58bb 100644 --- a/php/module.calendar.php +++ b/php/module.calendar.php @@ -287,8 +287,9 @@ class CalendarModule extends Module ]); // Add organizer - if(!empty( $this->getProp($messageProps, "sender_email_address"))) { - $vEvent->add('ORGANIZER', 'mailto:' . $this->getProp($messageProps, "sender_email_address")); + $organizer = $this->getProp($messageProps, "sender_email_address"); + if(!empty($organizer)) { + $vEvent->add('ORGANIZER', 'mailto:' . $organizer); $vEvent->ORGANIZER['CN'] = $this->getProp($messageProps, "sender_name"); } @@ -332,10 +333,11 @@ class CalendarModule extends Module } // Add categories - if (!empty($this->getProp($messageProps, "categories"))) { - $categories = array_map('trim', explode(';', trim($this->getProp($messageProps, "categories"), " ;"))); + $categories = $this->getProp($messageProps, "categories"); + if (!empty($categories)) { + $categoryArray = array_map('trim', explode(';', trim($categories, " ;"))); - $vEvent->add('CATEGORIES', $categories); + $vEvent->add('CATEGORIES', $categoryArray); } }