Skip to content

Commit

Permalink
Merge branch 'MDL-81577-404' of https://github.com/paulholden/moodle
Browse files Browse the repository at this point in the history
…into MOODLE_404_STABLE
  • Loading branch information
HuongNV13 committed Jun 13, 2024
2 parents 89d93d2 + 89d9032 commit 7b3d547
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
10 changes: 4 additions & 6 deletions mod/forum/rsslib.php
Original file line number Diff line number Diff line change
Expand Up @@ -314,8 +314,6 @@ function forum_rss_get_group_sql($cm, $groupmode, $currentgroup, $modcontext=nul
function forum_rss_feed_contents($forum, $sql, $params, $context) {
global $CFG, $DB, $USER;

$status = true;

$recs = $DB->get_recordset_sql($sql, $params, 0, $forum->rssarticles);

//set a flag. Are we displaying discussions or posts?
Expand All @@ -328,7 +326,6 @@ function forum_rss_feed_contents($forum, $sql, $params, $context) {
throw new \moodle_exception('invalidcoursemodule');
}

$formatoptions = new stdClass();
$items = array();
foreach ($recs as $rec) {
$item = new stdClass();
Expand Down Expand Up @@ -377,7 +374,6 @@ function forum_rss_feed_contents($forum, $sql, $params, $context) {
$item->author = fullname($rec);
$message = file_rewrite_pluginfile_urls($rec->postmessage, 'pluginfile.php', $context->id,
'mod_forum', 'post', $rec->postid);
$formatoptions->trusted = $rec->posttrust;
}

if ($isdiscussion) {
Expand All @@ -386,8 +382,10 @@ function forum_rss_feed_contents($forum, $sql, $params, $context) {
$item->link = $CFG->wwwroot."/mod/forum/discuss.php?d=".$rec->discussionid."&parent=".$rec->postid;
}

$formatoptions->trusted = $rec->posttrust;
$item->description = format_text($message, $rec->postformat, $formatoptions, $forum->course);
$item->description = format_text($message, $rec->postformat, [
'context' => $context,
'trusted' => $rec->posttrust,
]);

//TODO: MDL-31129 implement post attachment handling
/*if (!$isdiscussion) {
Expand Down
8 changes: 4 additions & 4 deletions mod/glossary/rsslib.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,6 @@ function glossary_rss_get_feed($context, $args) {

$items = array();

$formatoptions = new stdClass();
$formatoptions->trusttext = true;

foreach ($recs as $rec) {
$item = new stdClass();
$item->title = $rec->entryconcept;
Expand All @@ -97,7 +94,10 @@ function glossary_rss_get_feed($context, $args) {

$definition = file_rewrite_pluginfile_urls($rec->entrydefinition, 'pluginfile.php',
$modcontext->id, 'mod_glossary', 'entry', $rec->entryid);
$item->description = format_text($definition, $rec->entryformat, $formatoptions, $glossary->course);
$item->description = format_text($definition, $rec->entryformat, [
'context' => $modcontext,
'trusted' => true,
]);
$items[] = $item;
}

Expand Down

0 comments on commit 7b3d547

Please sign in to comment.