From c880f3919e7cb4c25f7ed90c7997d98734a134ce Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Thu, 20 Mar 2014 22:31:22 -0600 Subject: [PATCH] [mms] Fix fatal error if using TNEF viewer and bcmath extension is not installed on the system. --- framework/Mime_Viewer/lib/Horde/Mime/Viewer/Tnef.php | 12 ++++++++---- framework/Mime_Viewer/package.xml | 4 ++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/framework/Mime_Viewer/lib/Horde/Mime/Viewer/Tnef.php b/framework/Mime_Viewer/lib/Horde/Mime/Viewer/Tnef.php index 4d42eb551fb..c62d5138796 100644 --- a/framework/Mime_Viewer/lib/Horde/Mime/Viewer/Tnef.php +++ b/framework/Mime_Viewer/lib/Horde/Mime/Viewer/Tnef.php @@ -66,11 +66,15 @@ public function __construct(Horde_Mime_Part $part, array $conf = array()) protected function _getEmbeddedMimeParts() { /* Get the data from the attachment. */ - if (!($tnef = $this->getConfigParam('tnef'))) { - $tnef = Horde_Compress::factory('Tnef'); - $this->setConfigParam('tnef', $tnef); + try { + if (!($tnef = $this->getConfigParam('tnef'))) { + $tnef = Horde_Compress::factory('Tnef'); + $this->setConfigParam('tnef', $tnef); + } + $tnefData = $tnef->decompress($this->_mimepart->getContents()); + } catch (Horde_Compress_Exception $e) { + $tnefData = array(); } - $tnefData = $tnef->decompress($this->_mimepart->getContents()); if (!count($tnefData)) { return null; diff --git a/framework/Mime_Viewer/package.xml b/framework/Mime_Viewer/package.xml index 307f9ebf48f..5a9c902a30a 100644 --- a/framework/Mime_Viewer/package.xml +++ b/framework/Mime_Viewer/package.xml @@ -22,7 +22,7 @@ LGPL-2.1 -* +* [mms] Fix fatal error if using TNEF viewer and bcmath extension is not installed on the system. @@ -997,7 +997,7 @@ 2013-05-28 LGPL-2.1 -* +* [mms] Fix fatal error if using TNEF viewer and bcmath extension is not installed on the system.