Skip to content

Commit

Permalink
MDL-65355 course: Render course search encoded characters correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
rhell4 committed Dec 13, 2024
1 parent a97ddeb commit ae5bfeb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion course/renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -2041,7 +2041,10 @@ public function get_course_formatted_name($course, $options = array()) {
}
$name = format_string(get_course_display_name_for_list($course), true, $options);
if (!empty($this->searchcriteria['search'])) {
$name = highlight($this->searchcriteria['search'], $name);
// The course name we are highlighting is a formatted string,
// so the search term should also be a formatted string to match.
$search = format_string($this->searchcriteria['search'], true, $options);
$name = highlight($search, $name);
}
return $name;
}
Expand Down

0 comments on commit ae5bfeb

Please sign in to comment.