From bc24995eeb6d23301fb3d5da6160a43a9e6fe8b0 Mon Sep 17 00:00:00 2001 From: Christoph Haas Date: Mon, 5 Dec 2016 20:27:36 +0100 Subject: [PATCH] Fix PHP 5.4 compatibility --- php/module.contact.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/php/module.contact.php b/php/module.contact.php index cf0897c..6a7997c 100644 --- a/php/module.contact.php +++ b/php/module.contact.php @@ -397,9 +397,10 @@ class ContactModule extends Module $vCard->addNote($notes); } - if (!empty($this->getProp($messageProps, "categories"))) { - $categories = array_map('trim', explode(';', trim($this->getProp($messageProps, "categories"), " ;"))); - $vCard->addCategories($categories); + $categories = $this->getProp($messageProps, "categories"); + if (!empty($categories)) { + $categoryArray = array_map('trim', explode(';', trim($categories, " ;"))); + $vCard->addCategories($categoryArray); } $hasPicture = $this->getProp($messageProps, "has_picture");