RecursiveDirectoryIterator throws a fatal error if the directory doesn't exist, so...
authorChuck Hagenbuch <chuck@horde.org>
Thu, 25 Nov 2010 02:38:27 +0000 (21:38 -0500)
committerChuck Hagenbuch <chuck@horde.org>
Thu, 25 Nov 2010 02:38:27 +0000 (21:38 -0500)
framework/Core/lib/Horde/Themes/Cache.php

index b343dc1..74daa09 100644 (file)
@@ -111,8 +111,9 @@ class Horde_Themes_Cache implements Serializable
     protected function _build($app, $theme, $mask)
     {
         $path = $GLOBALS['registry']->get('themesfs', $app) . '/'. $theme;
-        $it = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path));
+        if (!is_readable($path)) { return; }
 
+        $it = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($path));
         foreach ($it as $val) {
             if (!$val->isDir()) {
                 $sub = $it->getSubPathname();