From 829e7ae8a33469b7744439f55ba7c14d270ff8d8 Mon Sep 17 00:00:00 2001 From: Michael Aherne Date: Thu, 26 Jan 2017 10:45:52 +0000 Subject: [PATCH 1/2] 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..7073843fd4c 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 (Exception $e) { + rss_error(); +} $PAGE->set_context($context); From 049838f998b6364d6f00d4a83d73f01b9348ad29 Mon Sep 17 00:00:00 2001 From: Michael Aherne Date: Thu, 26 Jan 2017 10:45:52 +0000 Subject: [PATCH 2/2] MDL-57777 rss: Return 404 when context not found. --- rss/file.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rss/file.php b/rss/file.php index 7073843fd4c..9a31a11fa34 100644 --- a/rss/file.php +++ b/rss/file.php @@ -117,7 +117,7 @@ if ($token === "$inttoken") { // Check the context actually exists. try { list($context, $course, $cm) = get_context_info_array($contextid); -} catch (Exception $e) { +} catch (dml_missing_record_exception $e) { rss_error(); }