From 1d8a1a87de472f3ddc8dfd7ae0eb6ddffe5fae13 Mon Sep 17 00:00:00 2001 From: Sam Hemelryk Date: Wed, 20 Mar 2013 17:27:08 +1300 Subject: [PATCH] MDL-38055 course: fixed double encoding of title properties --- blocks/course_overview/renderer.php | 3 ++- lib/navigationlib.php | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/blocks/course_overview/renderer.php b/blocks/course_overview/renderer.php index b0b4507a0a3..1ac4e90312f 100644 --- a/blocks/course_overview/renderer.php +++ b/blocks/course_overview/renderer.php @@ -101,7 +101,8 @@ class block_course_overview_renderer extends plugin_renderer_base { } - $attributes = array('title' => s($course->fullname)); + // No need to pass title through s() here as it will be done automatically by html_writer. + $attributes = array('title' => $course->fullname); if ($course->id > 0) { $courseurl = new moodle_url('/course/view.php', array('id' => $course->id)); $coursefullname = format_string($course->fullname, true, $course->id); diff --git a/lib/navigationlib.php b/lib/navigationlib.php index 432a120dad6..da2f7b3c7d3 100644 --- a/lib/navigationlib.php +++ b/lib/navigationlib.php @@ -2367,7 +2367,9 @@ class global_navigation extends navigation_node { $coursenode = $parent->add($coursename, $url, self::TYPE_COURSE, $shortname, $course->id); $coursenode->nodetype = self::NODETYPE_BRANCH; $coursenode->hidden = (!$course->visible); - $coursenode->title($fullname); + // We need to decode &'s here as they will have been added by format_string above and attributes will be encoded again + // later. + $coursenode->title(str_replace('&', '&', $fullname)); if (!$forcegeneric) { $this->addedcourses[$course->id] = $coursenode; }