MDL-86830 calendar: Fix double encoding in event title attributes

This commit is contained in:
Andi Permana
2025-12-08 10:44:07 +07:00
parent a5b3ac7e43
commit e9688d295f
2 changed files with 18 additions and 14 deletions
+1 -1
View File
@@ -70,7 +70,7 @@ class event_exporter_base extends exporter {
$data = new \stdClass();
$data->id = $event->get_id();
$data->name = $event->get_name();
$data->name = clean_string($event->get_name());
$data->description = file_rewrite_pluginfile_urls(
$event->get_description()->get_value(),
'pluginfile.php',
+17 -13
View File
@@ -15,11 +15,11 @@ Feature: Perform basic calendar functionality
| name | category | idnumber |
| CatA | 0 | cata |
And the following "courses" exist:
| fullname | shortname | format | category |
| Course 1 | C1 | topics | cata |
| Course 2 | C2 | topics | cata |
| Course 3 | C3 | topics | cata |
| Course 4 | C4 | topics | cata |
| fullname | shortname | format | category | startdate |
| Course 1 | C1 | topics | cata | ##first day of last month## |
| Course 2 | C2 | topics | cata | ##first day of last month## |
| Course 3 | C3 | topics | cata | ##first day of last month## |
| Course 4 | C4 | topics | cata | ##first day of last month## |
And the following "course enrolments" exist:
| user | course | role |
| student1 | C1 | student |
@@ -58,20 +58,24 @@ Feature: Perform basic calendar functionality
Scenario: Create a course event
Given I log in as "teacher1"
And I create a calendar event with form data:
| Type of event | course |
| Course | Course 1 |
| Event title | Really awesome event! |
| Description | Come join this awesome event, sucka! |
| Type of event | course |
| Course | Course 1 |
| timestart[day] | 1 |
| Event title | Really awesome event! & < > " ' |
| Description | Come join this awesome event, sucka! |
And I log out
When I am on the "Course 1" course page logged in as student1
And I follow "Course calendar"
And I click on "Really awesome event!" "link"
And "Course 1" "link" should exist in the "Really awesome event!" "dialogue"
And I click on "Close" "button" in the "Really awesome event!" "dialogue"
And I hover over day "1" of this month in the full calendar page
And I should see "Really awesome event! & < > \" '"
And I click on "Really awesome event! & < > \" '" "link"
And I should see "Really awesome event! & < > \" '" in the ".modal-title" "css_element"
And I should see "Course 1" in the ".modal-body" "css_element"
And I click on "Close" "button" in the ".modal-content" "css_element"
And I log out
And I log in as "student2"
And I follow "Full calendar"
Then I should not see "Really awesome event!"
Then I should not see "Really awesome event! & < > \" '"
@javascript
Scenario: Create a group event