Replaced _variable() style calls with _param() style calls plus other

mods to suit.
This commit is contained in:
thepurpleblob
2005-06-16 10:15:02 +00:00
parent 93d58b30f3
commit 1270a3a7ed
7 changed files with 12 additions and 10 deletions
+1 -1
View File
@@ -3,7 +3,7 @@
require_once("../../config.php");
require_once("lib.php");
require_variable($id); // course
$id = require_param('id',PARAM_INT); // course
redirect("$CFG->wwwroot/course/view.php?id=$id");
+2 -2
View File
@@ -2,8 +2,8 @@
require_once("../../config.php");
optional_variable($id); // Course Module ID, or
optional_variable($l); // Label ID
$id = optional_param('id',0,PARAM_INT); // Course Module ID, or
$l = optional_param('l',0,PARAM_INT); // Label ID
if ($id) {
if (! $cm = get_record("course_modules", "id", $id)) {
+2 -2
View File
@@ -4,8 +4,8 @@
require_once("../../config.php");
require_once("lib.php");
require_variable($id); // Course Module ID
require_variable($url); // url to fetch
$id = required_param('id',0,PARAM_INT); // Course Module ID
$url = required_param('url'); // url to fetch
if (! $cm = get_record("course_modules", "id", $id)) {
error("Course Module ID was incorrect");
+1 -1
View File
@@ -2,7 +2,7 @@
require_once("../../config.php");
require_variable($id); // course
$id = required_param( 'id', 0, PARAM_INT ); // course
if (!empty($CFG->forcelogin)) {
require_login();
@@ -19,8 +19,8 @@ function display() {
$resource = $this->resource;
require_once($CFG->libdir.'/filelib.php');
$subdir = isset($_GET['subdir']) ? $_GET['subdir'] : '';
$subdir = optional_param( 'subdir','' );
add_to_log($course->id, "resource", "view", "view.php?id={$cm->id}", $resource->id, $cm->id);
+2 -1
View File
@@ -89,7 +89,8 @@ function display() {
$pagetitle = strip_tags($course->shortname.': '.format_string($resource->name));
$formatoptions->noclean = true;
$inpopup = !empty($_GET["inpopup"]);
$inpopup_param = optional_param( 'inpopup','' );
$inpopup = !empty($inpopup_param);
if ($resource->popup) {
if ($inpopup) { /// Popup only
+2 -1
View File
@@ -87,7 +87,8 @@ function display() {
$pagetitle = strip_tags($course->shortname.': '.format_string($resource->name));
$formatoptions->noclean = true;
$inpopup = !empty($_GET["inpopup"]);
$inpopup_param = optional_param( 'inpopup', '' );
$inpopup = !empty($inpopup_param);
if ($resource->popup) {
if ($inpopup) { /// Popup only