From 18b9d66439fe42ff04657b49dcfbc8157ac55027 Mon Sep 17 00:00:00 2001 From: moodler Date: Tue, 1 Feb 2005 08:00:58 +0000 Subject: [PATCH] Moved theme changing to after SESSION exists --- lib/setup.php | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/lib/setup.php b/lib/setup.php index 8917a25938..01267538a3 100644 --- a/lib/setup.php +++ b/lib/setup.php @@ -211,22 +211,6 @@ global $THEME; $CFG->moddata = 'moddata'; -/// Load up theme variables (colours etc) - if (isset($_GET['theme'])) { - if (confirm_sesskey()) { - if (!detect_munged_arguments($_GET['theme'], 0) and file_exists($CFG->dirroot .'/theme/'. $_GET['theme'])) { - $SESSION->theme = $_GET['theme']; - } - } - } - - if (!isset($CFG->theme)) { - $CFG->theme = 'standard'; - } - - theme_setup(); // Sets up theme global variables - - /// A hack to get around magic_quotes_gpc being turned off if (!ini_get_bool('magic_quotes_gpc') ) { @@ -318,6 +302,24 @@ global $THEME; // session_register("SESSION"); + +/// Load up theme variables (colours etc) + if (isset($_GET['theme'])) { + if (confirm_sesskey()) { + if (!detect_munged_arguments($_GET['theme'], 0) and file_exists($CFG->dirroot .'/theme/'. $_GET['theme'])) { + $SESSION->theme = $_GET['theme']; + } + } + } + + if (!isset($CFG->theme)) { + $CFG->theme = 'standard'; + } + + theme_setup(); // Sets up theme global variables + + + /// Set language/locale of printed times. If user has chosen a language that /// that is different from the site language, then use the locale specified /// in the language file. Otherwise, if the admin hasn't specified a locale -- 2.39.5