From 4e3e03e446b102eddd9693c287dff80dc61a36e2 Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Mon, 10 Feb 2014 13:24:08 +0000 Subject: [PATCH] fix problem regarding display / visualization of .ics attachments --- mail/inc/class.mail_ui.inc.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/mail/inc/class.mail_ui.inc.php b/mail/inc/class.mail_ui.inc.php index f8f3743633..c86b8e5b61 100644 --- a/mail/inc/class.mail_ui.inc.php +++ b/mail/inc/class.mail_ui.inc.php @@ -2388,9 +2388,10 @@ unset($query['actions']); $this->mail_bo->closeConnection(); $GLOBALS['egw']->session->commit_session(); + //error_log(__METHOD__.print_r($_GET,true)); if ($_GET['mode'] != "save") { - if (strtoupper($attachment['type']) == 'TEXT/DIRECTORY') + if (strtoupper($attachment['type']) == 'TEXT/DIRECTORY' || empty($attachment['type'])) { $sfxMimeType = $attachment['type']; $buff = explode('.',$attachment['filename']); @@ -2450,10 +2451,12 @@ unset($query['actions']); //Import failed, download content anyway } } - header ("Content-Type: ".$attachment['type']."; name=\"". $attachment['filename'] ."\""); + //error_log(__METHOD__.__LINE__.'->'.array2string($attachment)); + $filename = ($attachment['filename']?$attachment['filename']:$mailbox.'_uid'.$uid.'_part'.$part); + header ("Content-Type: ".$attachment['type']."; name=\"". $filename ."\""); if($_GET['mode'] == "save") { // ask for download - header ("Content-Disposition: attachment; filename=\"". $attachment['filename'] ."\""); + header ("Content-Disposition: attachment; filename=\"". $filename ."\""); } else { // display it header ("Content-Disposition: inline; filename=\"". $attachment['filename'] ."\"");