$themeDirectory = (is_null($pocheUser) ? DEFAULT_THEME : $pocheUser->getConfigValue('theme'));
- if ($themeDirectory === false) {
+ if ($themeDirectory === false || !is_dir(THEME . '/' . $themeDirectory)) {
$themeDirectory = DEFAULT_THEME;
}
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;
}
Tools::emptyCache();
Tools::redirect('?view=config');
}
-}
\ No newline at end of file
+}