From: moodler Date: Fri, 9 May 2003 02:32:43 +0000 (+0000) Subject: IMPORTANT SECURITY FIX: prevents external PHP code from being run X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=bbc0d9abbf6a0d8f2ace8275c992aade35534d4a;p=moodle.git IMPORTANT SECURITY FIX: prevents external PHP code from being run --- diff --git a/theme/index.php b/theme/index.php index ae9be68ec6..32207efd62 100644 --- a/theme/index.php +++ b/theme/index.php @@ -5,7 +5,20 @@ optional_variable($preview); // which theme to show optional_variable($choose); // set this theme as default + if (! $site = get_site()) { + error("Site doesn't exist!"); + } + + require_login(); + + if (!isadmin()) { + error("You must be an administrator to change themes."); + } + if ($choose) { + if (!is_dir($choose)) { + error("This theme is not installed!"); + } $preview = $choose; } @@ -17,18 +30,6 @@ include ("$CFG->theme/config.php"); } - - if (! $site = get_site()) { - error("Site doesn't exist!"); - } - - require_login(); - - if (!isadmin()) { - error("You must be an administrator to change themes."); - } - - $stradministration = get_string("administration"); $strchoosetheme = get_string("choosetheme"); $strpreview = get_string("preview");