@@ -70,24 +70,25 @@ public function __construct()
7070
7171 $ this ->theme = new Theme ();
7272
73- $ configThemeExists = true ;
74-
75- if (! $ this ->checkTheme ($ GLOBALS ['cfg ' ]['ThemeDefault ' ])) {
73+ $ configThemeExists = $ this ->checkTheme ($ GLOBALS ['cfg ' ]['ThemeDefault ' ]);
74+ if (! $ configThemeExists ) {
7675 trigger_error (
7776 sprintf (
7877 __ ('Default theme %s not found! ' ),
7978 htmlspecialchars ($ GLOBALS ['cfg ' ]['ThemeDefault ' ]),
8079 ),
8180 E_USER_ERROR ,
8281 );
83- $ configThemeExists = false ;
8482 } else {
8583 $ this ->themeDefault = $ GLOBALS ['cfg ' ]['ThemeDefault ' ];
8684 }
8785
8886 // check if user have a theme cookie
8987 $ cookieTheme = $ this ->getThemeCookie ();
90- if ($ cookieTheme && $ this ->setActiveTheme ($ cookieTheme )) {
88+ if (
89+ $ cookieTheme && $ this ->setActiveTheme ($ cookieTheme )
90+ || $ configThemeExists && $ this ->setActiveTheme ($ this ->themeDefault )
91+ ) {
9192 $ colorMode = $ this ->getColorModeCookie ();
9293 if (is_string ($ colorMode ) && $ colorMode !== '' ) {
9394 $ this ->theme ->setColorMode ($ colorMode );
@@ -96,13 +97,7 @@ public function __construct()
9697 return ;
9798 }
9899
99- if ($ configThemeExists ) {
100- // otherwise use default theme
101- $ this ->setActiveTheme ($ this ->themeDefault );
102- } else {
103- // or fallback theme
104- $ this ->setActiveTheme (self ::FALLBACK_THEME );
105- }
100+ $ this ->setActiveTheme (self ::FALLBACK_THEME );
106101 }
107102
108103 /**
0 commit comments