From 2d187ab0ed14eeca1d5d15af1c6848ab99d7ab73 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Wed, 24 Nov 2010 20:37:52 -0700 Subject: [PATCH] RecursiveDirectoryIterator was expected to throw an exception But in hindsight that doesn't make sense. So catch the exception and skip processing if caught. --- framework/Core/lib/Horde/Themes/Cache.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/framework/Core/lib/Horde/Themes/Cache.php b/framework/Core/lib/Horde/Themes/Cache.php index 74daa0993..46f22d0fa 100644 --- a/framework/Core/lib/Horde/Themes/Cache.php +++ b/framework/Core/lib/Horde/Themes/Cache.php @@ -79,7 +79,6 @@ class Horde_Themes_Cache implements Serializable * Build the entire theme data structure. * * @return array The list of theme files. - * @throws UnexpectedValueException */ public function build() { @@ -105,15 +104,17 @@ class Horde_Themes_Cache implements Serializable * @param string $app The application name. * @param string $theme The theme name. * @param integer $mask Mask for the app/theme combo. - * - * @throws UnexpectedValueException */ protected function _build($app, $theme, $mask) { $path = $GLOBALS['registry']->get('themesfs', $app) . '/'. $theme; - if (!is_readable($path)) { return; } - $it = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path)); + try { + $it = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path)); + } catch (UnexpectedValueException $e) { + return; + } + foreach ($it as $val) { if (!$val->isDir()) { $sub = $it->getSubPathname(); -- 2.11.0