Fixed incorrect use of optional_param.
authordefacer <defacer>
Thu, 27 Jan 2005 23:48:16 +0000 (23:48 +0000)
committerdefacer <defacer>
Thu, 27 Jan 2005 23:48:16 +0000 (23:48 +0000)
Fixed the double-header bug when configuring a block in the front page,
as reported in bug #2440. Credits to Dan Marsden for the report and the fix.

index.php

index 503390712237858735586157ac6c363c7ee7248e..ff922509777a13cc5df8e60f6570fd02b43dff22 100644 (file)
--- a/index.php
+++ b/index.php
@@ -18,9 +18,9 @@
     require_once($CFG->dirroot .'/mod/resource/lib.php');
     require_once($CFG->dirroot .'/mod/forum/lib.php');
 
-    optional_param('blockaction');
-    optional_param('instanceid', 0, PARAM_INT);
-    optional_param('blockid',    0, PARAM_INT);
+    $blockaction = optional_param('blockaction');
+    $instanceid  = optional_param('instanceid', 0, PARAM_INT);
+    $blockid     = optional_param('blockid',    0, PARAM_INT);
 
     if (! $site = get_site()) {
         redirect($CFG->wwwroot .'/'. $CFG->admin .'/index.php');
 
     $PAGE = page_create_object(MOODLE_PAGE_COURSE, SITEID);
 
-    print_header(strip_tags($site->fullname), $site->fullname, 'home', '',
-                 '<meta name="description" content="'. s(strip_tags($site->summary)) .'" />',
-                 true, '', $loginstring . '<br />' . $langmenu);
-
     echo '<div id="entry-page" class="entry">';  // entry wrapper start
 
     $editing = $PAGE->user_is_editing();
     $preferred_width_right = min($preferred_width_right, BLOCK_R_MAX_WIDTH);
     $preferred_width_right = max($preferred_width_right, BLOCK_R_MIN_WIDTH);
 
+    print_header(strip_tags($site->fullname), $site->fullname, 'home', '',
+                 '<meta name="description" content="'. s(strip_tags($site->summary)) .'" />',
+                 true, '', $loginstring . '<br />' . $langmenu);
+
 ?>