diff --git a/lib/setup.php b/lib/setup.php index 220d3293c3085..d74fe2d2ba79d 100644 --- a/lib/setup.php +++ b/lib/setup.php @@ -700,7 +700,7 @@ function stripslashes_deep($value) { if (!isset($CFG->themes)) { $theme_obj = new stdClass(); $theme_obj->device = 'default'; - $theme_obj->theme = 'standardwhite'; + $theme = $theme_obj->theme = 'standardwhite'; $current_prefs[] = $theme_obj; $CFG->themes = json_encode($current_prefs); } @@ -733,7 +733,7 @@ function stripslashes_deep($value) { moodle_setlocale(); if (!empty($CFG->debugvalidators) and !empty($CFG->guestloginbutton)) { - if ($theme == 'standardwhite') { // Temporary measure to help with XHTML validation + if (!empty($theme) and $theme == 'standardwhite') { // Temporary measure to help with XHTML validation if (isset($_SERVER['HTTP_USER_AGENT']) and empty($USER->id)) { // Allow W3CValidator in as user called w3cvalidator (or guest) if ((strpos($_SERVER['HTTP_USER_AGENT'], 'W3C_Validator') !== false) or (strpos($_SERVER['HTTP_USER_AGENT'], 'Cynthia') !== false )) {