Skip to content

Commit

Permalink
Avoid $_REQUEST["id"] usage. MDL-14806 ; backported from 19_STABLE
Browse files Browse the repository at this point in the history
  • Loading branch information
stronk7 committed May 13, 2008
1 parent d02317b commit 4f75c6c
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions mod/wiki/view.php
Expand Up @@ -58,8 +58,6 @@
if (! $cm = get_coursemodule_from_instance("wiki", $wiki->id, $course->id)) {
error("Course Module ID was incorrect");
}
$id = $cm->id;
$_REQUEST["id"] = $id;
}

require_course_login($course, true, $cm);
Expand All @@ -70,9 +68,6 @@
/// Default format:
$moodle_format=FORMAT_MOODLE;

### SAVE ID from Moodle
$moodleID=@$_REQUEST["id"];

/// Globally disable CamelCase, if the option is selected for this wiki.
$moodle_disable_camel_case = ($wiki->disablecamelcase == 1);

Expand Down Expand Up @@ -137,7 +132,7 @@

/// Build the ewsiki script constant
/// ewbase will also be needed by EWIKI_SCRIPT_BINARY
$ewbase = 'view.php?id='.$moodleID;
$ewbase = 'view.php?id='.$cm->id;
if (isset($userid) && $userid!=0) $ewbase .= '&userid='.$userid;
if (isset($groupid) && $groupid!=0) $ewbase .= '&groupid='.$groupid;
$ewscript = $ewbase.'&page=';
Expand Down Expand Up @@ -246,9 +241,6 @@
$content=ewiki_page($page);
$content2='';

### RESTORE ID from Moodle
$_REQUEST["id"]=$moodleID;
$id=$moodleID;
/// ################# EWIKI Part ###########################
}
else {
Expand Down Expand Up @@ -436,7 +428,7 @@
print "
<form id='overridelock' method='post' action='overridelock.php'>
<input type='hidden' name='sesskey' value='$sesskey' />
<input type='hidden' name='id' value='$id' />
<input type='hidden' name='id' value='$cm->id' />
<input type='hidden' name='page' value='$pageesc' />
$stroverrideinfo
<input type='submit' value='$stroverridebutton' />
Expand Down

0 comments on commit 4f75c6c

Please sign in to comment.