diff --git a/config/mime_drivers.php b/config/mime_drivers.php index d3e6d6c92..5cd5ff196 100644 --- a/config/mime_drivers.php +++ b/config/mime_drivers.php @@ -231,6 +231,7 @@ 'handles' => [ 'text/calendar', 'text/x-vcalendar', + 'application/ics', ], 'icons' => [ 'default' => 'itip.png', diff --git a/lib/Ajax/Imple/ItipRequest.php b/lib/Ajax/Imple/ItipRequest.php index 914f55a54..50dc7775a 100644 --- a/lib/Ajax/Imple/ItipRequest.php +++ b/lib/Ajax/Imple/ItipRequest.php @@ -10,9 +10,9 @@ * @copyright 2012-2017 Horde LLC * @license http://www.horde.org/licenses/gpl GPL * @package IMP + */ use Horde\Util\Variables; - */ /** * Attach javascript used to process Itip actions into a page. @@ -22,8 +22,6 @@ * @copyright 2012-2017 Horde LLC * @license http://www.horde.org/licenses/gpl GPL * @package IMP - -use Horde\Util\Variables; */ class IMP_Ajax_Imple_ItipRequest extends Horde_Core_Ajax_Imple { diff --git a/lib/Ajax/Imple/PassphraseDialog.php b/lib/Ajax/Imple/PassphraseDialog.php index 6975b4227..44d84e15a 100644 --- a/lib/Ajax/Imple/PassphraseDialog.php +++ b/lib/Ajax/Imple/PassphraseDialog.php @@ -10,9 +10,9 @@ * @copyright 2010-2017 Horde LLC * @license http://www.horde.org/licenses/gpl GPL * @package IMP + */ use Horde\Util\Variables; - */ /** * Attach the passphrase dialog to the page. @@ -22,8 +22,6 @@ * @copyright 2010-2017 Horde LLC * @license http://www.horde.org/licenses/gpl GPL * @package IMP - -use Horde\Util\Variables; */ class IMP_Ajax_Imple_PassphraseDialog extends Horde_Core_Ajax_Imple { diff --git a/lib/Ajax/Imple/VcardImport.php b/lib/Ajax/Imple/VcardImport.php index f0bd2dd6e..40a02bb16 100644 --- a/lib/Ajax/Imple/VcardImport.php +++ b/lib/Ajax/Imple/VcardImport.php @@ -10,9 +10,9 @@ * @copyright 2012-2017 Horde LLC * @license http://www.horde.org/licenses/gpl GPL * @package IMP + */ use Horde\Util\Variables; - */ /** * Attach javascript used to process a Vcard import request from IMP. @@ -22,8 +22,6 @@ * @copyright 2014-2017 Horde LLC * @license http://www.horde.org/licenses/gpl GPL * @package IMP - -use Horde\Util\Variables; */ class IMP_Ajax_Imple_VcardImport extends Horde_Core_Ajax_Imple { diff --git a/lib/Mime/Viewer/Itip.php b/lib/Mime/Viewer/Itip.php index 49f7c7742..87449a9de 100644 --- a/lib/Mime/Viewer/Itip.php +++ b/lib/Mime/Viewer/Itip.php @@ -361,10 +361,7 @@ protected function _vEvent($vevent, $id, $method = 'PUBLISH', $components = []) case 'REPLY': $desc = _('%s has replied to the invitation to "%s".'); - $from = $this->getConfigParam('imp_contents')->getHeader()->getHeader('from'); - $sender = $from - ? $from->getAddressList(true)->first()->bare_address - : null; + $sender = $this->_senderFromHeader(); if ($registry->hasMethod('calendar/updateAttendee') && $this->_autoUpdateReply(self::AUTO_UPDATE_EVENT_REPLY, $sender)) { try { @@ -752,10 +749,7 @@ protected function _vTodo($vtodo, $id, $method) case 'REPLY': $desc = _('%s has replied to the assignment of task "%s".'); - $from = $this->getConfigParam('imp_contents')->getHeader()->getHeader('from'); - $sender = $from - ? $from->getAddressList(true)->first()->bare_address - : null; + $sender = $this->_senderFromHeader(); if ($registry->hasMethod('tasks/updateAttendee') && $this->_autoUpdateReply(self::AUTO_UPDATE_TASK_REPLY, $sender)) { @@ -929,6 +923,18 @@ protected function _parseAttendees($data, $attendees) * * @return boolean */ + protected function _senderFromHeader() + { + $from = $this->getConfigParam('imp_contents')->getHeader()->getHeader('from'); + if (!$from) { + return null; + } + + $addr = $from->getAddressList(true)->first(); + + return $addr ? $addr->bare_address : null; + } + protected function _autoUpdateReply($type, $sender) { if (!empty($this->_conf[$type])) {