Skip to content

Commit

Permalink
MDL-82931 mod_data: Harden parsing of content format
Browse files Browse the repository at this point in the history
  • Loading branch information
PhMemmel committed Nov 20, 2024
1 parent 269a8a8 commit 5de5498
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mod/data/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,6 @@ protected function get_data_content(int $recordid) {
* @return bool|string
*/
function display_browse_field($recordid, $template) {
global $DB;
$content = $this->get_data_content($recordid);
if (!$content || !isset($content->content)) {
return '';
Expand All @@ -523,7 +522,8 @@ function display_browse_field($recordid, $template) {
$options->filter = false;
}
$options->para = false;
$str = format_text($content->content, $content->content1, $options);
$format = !empty($content->content1) && !empty(trim($content->content1)) ? $content->content1 : null;
$str = format_text($content->content, $format, $options);
return $str;
}

Expand Down

0 comments on commit 5de5498

Please sign in to comment.