mirror of
https://github.com/moodle/moodle.git
synced 2025-01-17 13:38:32 +01:00
MDL-81781 report_log: escape description selectively on display/export.
Per cd85e090f3 all content was escaped, however we should only do that when displaying the value in browser or exporting to file format which supports HTML.
This commit is contained in:
parent
f2dbbfe66e
commit
222fb603c0
@ -22,9 +22,11 @@
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
use core\dataformat;
|
||||
use core\report_helper;
|
||||
|
||||
defined('MOODLE_INTERNAL') || die;
|
||||
|
||||
global $CFG;
|
||||
require_once($CFG->libdir . '/tablelib.php');
|
||||
|
||||
@ -299,8 +301,11 @@ class report_log_table_log extends table_sql {
|
||||
* @return string HTML for the description column
|
||||
*/
|
||||
public function col_description($event) {
|
||||
// Description.
|
||||
return format_text($event->get_description(), FORMAT_PLAIN);
|
||||
if (empty($this->download) || dataformat::get_format_instance($this->download)->supports_html()) {
|
||||
return format_text($event->get_description(), FORMAT_PLAIN);
|
||||
} else {
|
||||
return $event->get_description();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user