Permalink
Browse files

Adding required_param or optional_param to clean up id's

  • Loading branch information...
1 parent d1edf55 commit ae6c928926266355549f38cabb0f1930251ae883 julmis committed Nov 17, 2005
View
@@ -1,6 +1,8 @@
<?php
include("../../config.php");
+ $id = optional_param('id', 0, PARAM_INT);
+
$lastmodified = filemtime("htmlarea.php");
$lifetime = 1800;
@@ -2,7 +2,7 @@
include("../../../config.php");
- require_variable($id);
+ $id = required_param('id', PARAM_INT);
if (!$course = get_record("course", "id", $id)) {
$course->fullname = ""; // Just to keep display happy, though browsing may fail
@@ -2,7 +2,7 @@
include("../../../config.php");
- require_variable($id);
+ $id = required_param('id', PARAM_INT);
if (!$course = get_record("course", "id", $id)) {
$course->fullname = ""; // Just to keep display happy, though browsing may fail
@@ -1,9 +1,7 @@
<?php // $Id$
include("../../../config.php");
- $id = $_GET['id'];
-
- require_variable($id);
+ $id = required_param('id', PARAM_INT);
if (!$course = get_record("course", "id", $id)) {
$course->fullname = ""; // Just to keep display happy, though browsing may fail
@@ -1,7 +1,7 @@
<?php // $Id$
include("../../../config.php");
- $id = required_param('id');
+ $id = required_param('id', PARAM_INT);
if ($course = get_record("course", "id", $id)) {
$isteacher = isteacher($course->id);

0 comments on commit ae6c928

Please sign in to comment.