mirror of
https://github.com/moodle/moodle.git
synced 2025-04-11 19:42:35 +02:00
MDL-82931 mod_data: Harden parsing of content format
This commit is contained in:
parent
269a8a8a1b
commit
5de5498807
@ -512,7 +512,6 @@ class data_field_base { // Base class for Database Field Types (see field/*/
|
||||
* @return bool|string
|
||||
*/
|
||||
function display_browse_field($recordid, $template) {
|
||||
global $DB;
|
||||
$content = $this->get_data_content($recordid);
|
||||
if (!$content || !isset($content->content)) {
|
||||
return '';
|
||||
@ -523,7 +522,8 @@ class data_field_base { // Base class for Database Field Types (see field/*/
|
||||
$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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user