From afb7ec92ff23afdc229d89a29fcc3e73ef785266 Mon Sep 17 00:00:00 2001 From: Dan Poltawski Date: Fri, 30 Oct 2015 14:14:24 +0000 Subject: [PATCH] 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.. --- blog/index.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/blog/index.php b/blog/index.php index ddbdf454245..56ab7eb8b91 100644 --- a/blog/index.php +++ b/blog/index.php @@ -63,9 +63,9 @@ if ($entryid and !isset($userid)) { $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();