diff --git a/public/mod/forum/classes/local/exporters/author.php b/public/mod/forum/classes/local/exporters/author.php index 17a3ceb8d5b..a7181f75e42 100644 --- a/public/mod/forum/classes/local/exporters/author.php +++ b/public/mod/forum/classes/local/exporters/author.php @@ -172,7 +172,7 @@ class author extends exporter { return [ 'id' => $group->id, - 'name' => format_string($group->name, true, ['context' => $context]), + 'name' => clean_string(format_string($group->name, true, ['context' => $context])), 'urls' => [ 'image' => $imageurl ? $imageurl->out(false) : null, 'group' => $groupurl ? $groupurl->out(false) : null diff --git a/public/mod/forum/classes/local/exporters/discussion.php b/public/mod/forum/classes/local/exporters/discussion.php index 8270d9fa378..27360f4febd 100644 --- a/public/mod/forum/classes/local/exporters/discussion.php +++ b/public/mod/forum/classes/local/exporters/discussion.php @@ -174,7 +174,7 @@ class discussion extends exporter { // or if it's been deleted and the discussion record hasn't been updated. if ($group) { $groupdata = [ - 'name' => format_string($group->name, true, ['context' => $this->related['context']]), + 'name' => clean_string(format_string($group->name, true, ['context' => $this->related['context']])), 'urls' => [], ]; diff --git a/public/mod/forum/tests/behat/discussion_navigation.feature b/public/mod/forum/tests/behat/discussion_navigation.feature index 50eca8ebe38..a717b93ce62 100644 --- a/public/mod/forum/tests/behat/discussion_navigation.feature +++ b/public/mod/forum/tests/behat/discussion_navigation.feature @@ -19,9 +19,9 @@ Feature: A user can navigate to previous and next discussions | student1 | C1 | student | | student2 | C1 | student | And the following "groups" exist: - | name | course | idnumber | - | Group 1 | C1 | G1 | - | Group 2 | C1 | G2 | + | name | course | idnumber | + | Group 1 & (EN) < '" > | C1 | G1 | + | Group 2 | C1 | G2 | And the following "group members" exist: | user | group | | teacher1 | G1 | @@ -96,7 +96,9 @@ Feature: A user can navigate to previous and next discussions And I should see "Discussion 2 Group 1" And I should see "Discussion 2 Group 2" And I follow "Test forum name" - And I select "Group 1" from the "Visible groups" singleselect + And I select "Group 1 & (EN) < '" from the "Visible groups" singleselect + And I should see "Group 1 & (EN) < '\" >" + And I should not see "&" And I follow "Discussion 1 Group 1" And I should see "Discussion 2 Group 0" And I should see "Discussion 2 Group 1"