MDL-57777 rss: Return 404 when context not found.
authorMichael Aherne <michael.aherne@strath.ac.uk>
Thu, 26 Jan 2017 10:45:52 +0000 (10:45 +0000)
committerMichael Aherne <michael.aherne@strath.ac.uk>
Tue, 31 Jan 2017 09:29:08 +0000 (09:29 +0000)
rss/file.php

index b0bd7a2..9a31a11 100644 (file)
@@ -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);