Fix PHP 5.4 compatibility

This commit is contained in:
Christoph Haas 2016-12-05 20:27:36 +01:00
parent 35a157ead9
commit bc24995eeb

View File

@ -397,9 +397,10 @@ class ContactModule extends Module
$vCard->addNote($notes); $vCard->addNote($notes);
} }
if (!empty($this->getProp($messageProps, "categories"))) { $categories = $this->getProp($messageProps, "categories");
$categories = array_map('trim', explode(';', trim($this->getProp($messageProps, "categories"), " ;"))); if (!empty($categories)) {
$vCard->addCategories($categories); $categoryArray = array_map('trim', explode(';', trim($categories, " ;")));
$vCard->addCategories($categoryArray);
} }
$hasPicture = $this->getProp($messageProps, "has_picture"); $hasPicture = $this->getProp($messageProps, "has_picture");