Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MDL-37818 - RSS - Prevent access to blocks while RSS context errors a…

…re displayed
  • Loading branch information...
commit dafe65e43843af1171128c3de560fc9c3437024f 1 parent 204383e
@jsnfwlr jsnfwlr authored damyon committed
Showing with 10 additions and 9 deletions.
  1. +10 −9 rss/file.php
View
19 rss/file.php
@@ -122,6 +122,11 @@
}
}
+// Check the context actually exists
+list($context, $course, $cm) = get_context_info_array($contextid);
+
+$PAGE->set_context($context);
+
$user = get_complete_user_data('id', $userid);
// let enrol plugins deal with new enrolments if necessary
@@ -129,14 +134,6 @@
session_set_user($user); //for login and capability checks
-// Check the context actually exists
-list($context, $course, $cm) = get_context_info_array($contextid);
-
-if (!$context) {
- rss_error();
-}
-$PAGE->set_context($context);
-
try {
$autologinguest = true;
$setwantsurltome = true;
@@ -165,7 +162,11 @@
if (function_exists($functionname)) {
// $pathname will be null if there was a problem (eg user doesn't have the necessary capabilities)
// NOTE:the component providing the feed must do its own capability checks and security
- $pathname = $functionname($context, $args);
+ try {
+ $pathname = $functionname($context, $args);
+ } catch (Exception $e) {
+ rss_error('rsserror');
+ }
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.