From: Michael M Slusarz Date: Fri, 20 Feb 2009 18:38:52 +0000 (-0700) Subject: Bug #8017: App might not have Mime driver config X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=e278450a195e8b515fbb33e93e40b9bb1a520b67;p=horde.git Bug #8017: App might not have Mime driver config --- diff --git a/framework/Mime/lib/Horde/Mime/Viewer.php b/framework/Mime/lib/Horde/Mime/Viewer.php index 0b72ab68e..f65d25e94 100644 --- a/framework/Mime/lib/Horde/Mime/Viewer.php +++ b/framework/Mime/lib/Horde/Mime/Viewer.php @@ -113,7 +113,7 @@ class Horde_Mime_Viewer return self::$_drivercache[$sig]; } - /* Make sure 'horde' mime_drivers config is loaded. */ + /* Make sure horde config is loaded. */ if (empty(self::$_config['mime_drivers']['horde'])) { $res = Horde::loadConfiguration('mime_drivers.php', array('mime_drivers', 'mime_drivers_map'), 'horde'); if (is_a($res, 'PEAR_Error')) { @@ -122,14 +122,14 @@ class Horde_Mime_Viewer self::$_config = $res; } - /* Make sure app's' mime_drivers config is loaded. */ + /* Make sure app's config is loaded. There is no requirement that + * an app have a separate config, so ignore any errors. */ if (($app != 'horde') && empty(self::$_config['mime_drivers'][$app])) { $res = Horde::loadConfiguration('mime_drivers.php', array('mime_drivers', 'mime_drivers_map'), $app); - if (is_a($res, 'PEAR_Error')) { - return false; + if (!is_a($res, 'PEAR_Error')) { + require_once 'Horde/Array.php'; + self::$_config = Horde_Array::array_merge_recursive_overwrite(self::$_config, $res); } - require_once 'Horde/Array.php'; - self::$_config = Horde_Array::array_merge_recursive_overwrite(self::$_config, $res); } $driver = '';