Merge pull request #14349 from williamdes/issue-14348

Patch for issue #14348 - $cfg['ThemeDefault'] > unknown theme > Error 500
This commit is contained in:
Maurício Meneghini Fauth 2018-06-13 17:29:46 -03:00 committed by GitHub
commit 586efc56ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -90,6 +90,8 @@ class ThemeManager
$this->theme = new Theme;
$config_theme_exists = true;
if (! $this->checkTheme($GLOBALS['cfg']['ThemeDefault'])) {
trigger_error(
sprintf(
@ -98,15 +100,16 @@ class ThemeManager
),
E_USER_ERROR
);
$GLOBALS['cfg']['ThemeDefault'] = false;
$config_theme_exists = false;
} else {
$this->theme_default = $GLOBALS['cfg']['ThemeDefault'];
}
$this->theme_default = $GLOBALS['cfg']['ThemeDefault'];
// check if user have a theme cookie
$cookie_theme = $this->getThemeCookie();
if (! $cookie_theme || ! $this->setActiveTheme($cookie_theme)) {
if ($GLOBALS['cfg']['ThemeDefault']) {
if ($config_theme_exists) {
// otherwise use default theme
$this->setActiveTheme($this->theme_default);
} else {