Skip to content

Commit

Permalink
Only set default theme if actual theme is not valid and default theme…
Browse files Browse the repository at this point in the history
… exists on an upgrade or migrate

For #992
  • Loading branch information
eSilverStrike committed Jul 23, 2022
1 parent d76f7d7 commit 9516a3b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
7 changes: 5 additions & 2 deletions public_html/admin/install/classes/Migrate.php
Original file line number Diff line number Diff line change
Expand Up @@ -912,8 +912,11 @@ public function step4()
}

if (!COM_validateTheme($theme)) {
$_CONF['theme'] = $_CONF['theme_geeklog_default'];
$config->set('theme', $_CONF['theme_geeklog_default']);
// Make sure default theme exists before switching to it
if (COM_validateTheme($_CONF['theme_geeklog_default'])) {
$_CONF['theme'] = $_CONF['theme_geeklog_default'];
$config->set('theme', $_CONF['theme_geeklog_default']);
}
}

/**
Expand Down
5 changes: 4 additions & 1 deletion public_html/admin/install/classes/Upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,10 @@ private function fixPathsAndUrls($path, $path_html, $site_url, $site_admin_url)
require_once $path_html . 'lib-common.php';

if (!COM_validateTheme($_CONF['theme'])) {
$config->set('theme', $_CONF['theme_geeklog_default']);
// Make sure default theme exists before switching to it
if (COM_validateTheme($_CONF['theme_geeklog_default'])) {
$config->set('theme', $_CONF['theme_geeklog_default']);
}
}

if (!file_exists($_CONF['path_images'] . 'articles')) {
Expand Down

0 comments on commit 9516a3b

Please sign in to comment.