Permalink
Browse files

MDL-35982 blog: prevent index throwing errors with 0 courseid

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 Oct 30, 2015
1 parent b9c333f commit 4b0075414e5796a10aae62d75e10f44c21e6bbd9
Showing with 2 additions and 2 deletions.
  1. +2 −2 blog/index.php
View
@@ -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();

0 comments on commit 4b00754

Please sign in to comment.