Skip to content

Commit

Permalink
MDL-35982 blog: prevent index throwing errors with 0 courseid
Browse files Browse the repository at this point in the history
Regression from MDL-49845 where Dave made the page not handle courseid = 0
and so now some urls will send you back to a db error..
  • Loading branch information
danpoltawski committed Nov 26, 2015
1 parent c18acb8 commit afb7ec9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions blog/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@
$userid = $entry->userid;
}

if (isset($userid) && !isset($courseid)) {
if (isset($userid) && empty($courseid)) {
$context = context_user::instance($userid);
} else if (isset($courseid) && $courseid != SITEID) {
} else if (!empty($courseid) && $courseid != SITEID) {
$context = context_course::instance($courseid);
} else {
$context = context_system::instance();
Expand Down

0 comments on commit afb7ec9

Please sign in to comment.