From 655727381d9f6a8994b3887034e3404d5f6e20fa Mon Sep 17 00:00:00 2001 From: Michael Aherne Date: Thu, 26 Jan 2017 10:45:52 +0000 Subject: [PATCH] MDL-57777 rss: Return 404 when context not found. --- rss/file.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rss/file.php b/rss/file.php index b0bd7a2b8ec..9a31a11fa34 100644 --- a/rss/file.php +++ b/rss/file.php @@ -115,7 +115,11 @@ if ($token === "$inttoken") { } // Check the context actually exists. -list($context, $course, $cm) = get_context_info_array($contextid); +try { + list($context, $course, $cm) = get_context_info_array($contextid); +} catch (dml_missing_record_exception $e) { + rss_error(); +} $PAGE->set_context($context);