]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - inc/poche/Template.class.php
@fivefilters via composer
[github/wallabag/wallabag.git] / inc / poche / Template.class.php
index b686f2ec783037553db3af677606b46a6256c215..4d0bfdbb13161c4a6c8b3a625bfd58bbfa1bd157 100644 (file)
@@ -24,7 +24,7 @@ class Template extends Twig_Environment
 
         $themeDirectory = (is_null($pocheUser) ? DEFAULT_THEME : $pocheUser->getConfigValue('theme'));
 
-        if ($themeDirectory === false) {
+        if ($themeDirectory === false || !is_dir(THEME . '/' . $themeDirectory)) {
             $themeDirectory = DEFAULT_THEME;
         }
 
@@ -181,7 +181,7 @@ class Template extends Twig_Environment
         while (($theme = readdir($handle)) !== false) {
             # Themes are stored in a directory, so all directory names are themes
             # @todo move theme installation data to database
-            if (!is_dir(THEME . '/' . $theme) || in_array($theme, array('.', '..'))) {
+            if (!is_dir(THEME . '/' . $theme) || in_array($theme, array('.', '..', '_global'))) {
                 continue;
             }
 
@@ -232,4 +232,4 @@ class Template extends Twig_Environment
         Tools::emptyCache();
         Tools::redirect('?view=config');
     }
-}
\ No newline at end of file
+}