]> git.wh0rd.org - tt-rss.git/blobdiff - classes/pref/prefs.php
preferences: set themes dropdown to default if selected theme is missing
[tt-rss.git] / classes / pref / prefs.php
index 1988649a5a0e7d6c74a5f13f71e49e609b3a3732..18ffcc720cd0f08e19965cd48f996c0a6ddc4928 100644 (file)
@@ -565,11 +565,13 @@ class Pref_Prefs extends Handler_Protected {
 
                        } else if ($pref_name == "USER_CSS_THEME") {
 
-                               $themes = array_merge(glob("themes/*.css"), glob("themes.local/*.css"));
+                               $themes = array_merge(glob("themes/*.php"), glob("themes/*.css"), glob("themes.local/*.css"));
                                $themes = array_map("basename", $themes);
                                $themes = array_filter($themes, "theme_valid");
                                asort($themes);
 
+                               if (!theme_valid($value)) $value = "default.php";
+
                                print_select($pref_name, $value, $themes,
                                        'dojoType="dijit.form.Select"');