diff --git a/lib/Horde/Core/ActiveSync/Driver.php b/lib/Horde/Core/ActiveSync/Driver.php index 3df64551..a48fb350 100644 --- a/lib/Horde/Core/ActiveSync/Driver.php +++ b/lib/Horde/Core/ActiveSync/Driver.php @@ -1408,8 +1408,8 @@ public function getMessage($folderid, $id, array $collection) $message = $this->_connector->calendar_export($id, [ 'protocolversion' => $this->_version, 'truncation' => empty($collection['truncation']) ? Horde_ActiveSync::TRUNCATION_9 : $collection['truncation'], - 'bodyprefs' => $collection['bodyprefs'], - 'mimesupport' => $collection['mimesupport']], $folder_id); + 'bodyprefs' => $collection['bodyprefs'] ?? [], + 'mimesupport' => $collection['mimesupport'] ?? 0], $folder_id); // Nokia MfE requires the optional UID element. if (!$message->getUid()) { @@ -1459,8 +1459,8 @@ public function getMessage($folderid, $id, array $collection) $message = $this->_connector->contacts_export($id, [ 'protocolversion' => $this->_version, 'truncation' => empty($collection['truncation']) ? Horde_ActiveSync::TRUNCATION_9 : $collection['truncation'], - 'bodyprefs' => $collection['bodyprefs'], - 'mimesupport' => $collection['mimesupport'], + 'bodyprefs' => $collection['bodyprefs'] ?? [], + 'mimesupport' => $collection['mimesupport'] ?? 0, 'device' => $this->_device]); } catch (Horde_Exception_NotFound $e) { $this->_logger->err($e->getMessage()); @@ -1477,9 +1477,9 @@ public function getMessage($folderid, $id, array $collection) try { $message = $this->_connector->tasks_export($id, [ 'protocolversion' => $this->_version, - 'truncation' => $collection['truncation'], - 'bodyprefs' => $collection['bodyprefs'], - 'mimesupport' => $collection['mimesupport']]); + 'truncation' => $collection['truncation'] ?? Horde_ActiveSync::TRUNCATION_9, + 'bodyprefs' => $collection['bodyprefs'] ?? [], + 'mimesupport' => $collection['mimesupport'] ?? 0]); } catch (Horde_Exception_NotFound $e) { $this->_logger->err($e->getMessage()); $this->_endBuffer(); @@ -1495,9 +1495,9 @@ public function getMessage($folderid, $id, array $collection) try { $message = $this->_connector->notes_export($id, [ 'protocolversion' => $this->_version, - 'truncation' => $collection['truncation'], - 'bodyprefs' => $collection['bodyprefs'], - 'mimesupport' => $collection['mimesupport']]); + 'truncation' => $collection['truncation'] ?? Horde_ActiveSync::TRUNCATION_9, + 'bodyprefs' => $collection['bodyprefs'] ?? [], + 'mimesupport' => $collection['mimesupport'] ?? 0]); } catch (Horde_Exception_NotFound $e) { $this->_logger->err($e->getMessage()); $this->_endBuffer(); @@ -1517,27 +1517,19 @@ public function getMessage($folderid, $id, array $collection) [$id], [ 'protocolversion' => $this->_version, - 'truncation' => !empty($collection['truncation']) - ? $collection['truncation'] - : (!empty($collection['mimetruncation']) ? $collection['mimetruncation'] : false), - 'bodyprefs' => $collection['bodyprefs'], - 'bodypartprefs' => !empty($collection['bodypartprefs']) - ? $collection['bodypartprefs'] - : false, - 'mimesupport' => $collection['mimesupport'], + 'truncation' => $collection['truncation'] ?? $collection['mimetruncation'] ?? false), + 'bodyprefs' => $collection['bodyprefs'] ?? [], + 'bodypartprefs' => $collection['bodypartprefs'] ?? false, + 'mimesupport' => $collection['mimesupport'] ?? : 0, ] ); } catch (Horde_ActiveSync_Exception $e) { $this->_logger->err($e->getMessage()); $context = 'Protocol Version: ' . $this->_version . "\r\n" - . 'Truncation: ' . (!empty($collection['truncation']) - ? $collection['truncation'] - : (!empty($collection['mimetruncation']) ? $collection['mimetruncation'] : 'false')). "\r\n" - . 'BodyPrefs: ' . print_r($collection['bodyprefs'], true) . "\r\n" - . 'BodyPartPrefs: ' . (!empty($collection['bodypartprefs']) - ? print_r($collection['bodypartprefs'], true) - : 'false') . "\r\n" - . 'MimeSupport: ' . $collection['mimesupport']; + . 'Truncation: ' . ($collection['truncation'] ?? $collection['mimetruncation'] ?? 'false') . "\r\n" + . 'BodyPrefs: ' . print_r($collection['bodyprefs'] ?? [], true) . "\r\n" + . 'BodyPartPrefs: ' . print_r($collection['bodypartprefs'] ?? 'false', true) . "\r\n" + . 'MimeSupport: ' . ($collection['mimesupport'] ?? 0); $this->_logger->err($context);