From 622a107ce8a077474a75df8d075e659490322144 Mon Sep 17 00:00:00 2001 From: Michael Pound Date: Mon, 17 Feb 2025 17:53:08 +0000 Subject: [PATCH] TW21243544, cleaning comments for exporting --- classes/tables/comments_table.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/classes/tables/comments_table.php b/classes/tables/comments_table.php index a7e5027..7aaf509 100644 --- a/classes/tables/comments_table.php +++ b/classes/tables/comments_table.php @@ -134,6 +134,17 @@ public function other_cols($colname, $value) { } } + /** + * Format each row of returned data. + * + * @param array|object $row row of data from db used to make one row of the table. + * @return array one row for the table with sanitised content. + */ + public function format_row($row): array { + $row->content = clean_param($row->content, PARAM_TEXT); + return parent::format_row($row); + } + /** * Displays the table. */