Skip to content

Commit

Permalink
MDL-23856 fixed incorrect integer comparison, we should not use === o…
Browse files Browse the repository at this point in the history
…r !== because one may be integer and the other string
  • Loading branch information
skodak committed Aug 18, 2010
1 parent 99f9f85 commit 7b2e259
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion login/change_password.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
$id = optional_param('id', SITEID, PARAM_INT); // current course

$url = new moodle_url('/login/change_password.php');
if ($id !== SITEID) {
if ($id != SITEID) {
$url->param('id', $id);
}
$PAGE->set_url($url);
Expand Down
2 changes: 1 addition & 1 deletion message/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
if ($userid !== $USER->id) {
$url->param('id', $userid);
}
if ($course !== SITEID) {
if ($course != SITEID) {
$url->param('course', $course);
}
$PAGE->set_url($url);
Expand Down
2 changes: 1 addition & 1 deletion notes/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
$filterselect = optional_param('filterselect', 0, PARAM_INT);

$url = new moodle_url('/notes/index.php');
if ($courseid !== SITEID) {
if ($courseid != SITEID) {
$url->param('course', $courseid);
}
if ($userid !== 0) {
Expand Down
6 changes: 3 additions & 3 deletions pluginfile.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@
//TODO: nobody implemented this yet in grade edit form!!
send_file_not_found();

if ($CFG->forcelogin || $course->id !== SITEID) {
if ($CFG->forcelogin || $course->id != SITEID) {
require_login($course);
}

Expand Down Expand Up @@ -244,7 +244,7 @@

// Respect forcelogin and require login unless this is the site.... it probably
// should NEVER be the site
if ($CFG->forcelogin || $course->id !== SITEID) {
if ($CFG->forcelogin || $course->id != SITEID) {
require_login($course);
}

Expand Down Expand Up @@ -488,7 +488,7 @@
} else if ($filearea === 'section') {
if ($CFG->forcelogin) {
require_login($course);
} else if ($course->id !== SITEID) {
} else if ($course->id != SITEID) {
require_login($course);
}

Expand Down
2 changes: 1 addition & 1 deletion repository/manage_instances.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
$url->param('contextid', $contextid);
$baseurl->param('contextid', $contextid);
}
if ($usercourseid !== SITEID) {
if ($usercourseid != SITEID) {
$url->param('usercourseid', $usercourseid);
}

Expand Down

0 comments on commit 7b2e259

Please sign in to comment.