MDL-50641 rss: fix front page rss links
Fallback to guest user token when no user is specified in rss_get_url rather than generating a junk token which is no use to anyone, this matches existing logic which has been in place in forum for a while and avoids custom handling all over the place.
This commit is contained in:
@@ -81,6 +81,9 @@ function rss_get_link($contextid, $userid, $componentname, $id, $tooltiptext='')
|
||||
function rss_get_url($contextid, $userid, $componentname, $additionalargs) {
|
||||
global $CFG;
|
||||
require_once($CFG->libdir.'/filelib.php');
|
||||
if (empty($userid)) {
|
||||
$userid = guest_user()->id;
|
||||
}
|
||||
$usertoken = rss_get_token($userid);
|
||||
return get_file_url($contextid.'/'.$usertoken.'/'.$componentname.'/'.$additionalargs.'/rss.xml', null, 'rssfile');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user