Skip to content
This repository has been archived by the owner on May 29, 2024. It is now read-only.

Commit

Permalink
Safer isAcademic()
Browse files Browse the repository at this point in the history
Not sure why this suddenly started being an issue, but now we're also deciding that a course is not academic if we can't determine the parent account at all (not just if we can't determine if the parent account is academic).
  • Loading branch information
Seth Battis committed Nov 4, 2015
1 parent bd6bdee commit 3c2dc2a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion course/relative-grades.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ function isAcademic($account, $accounts = false) {
}
if ($account == 132) { // FIXME really, hard-coded values? Really?
return true;
} elseif ($account == 1) {
} elseif ($account == 1 || !is_integer($account)) {
return false;
} else {
return isAcademic($accounts[$account]['parent_account_id'], $accounts);
Expand Down

0 comments on commit 3c2dc2a

Please sign in to comment.