MDL-38055 course: fixed double encoding of title properties

Conflicts:
	lib/navigationlib.php
This commit is contained in:
Sam Hemelryk
2013-03-20 17:28:43 +13:00
parent 29f8c0937a
commit fb3ff98014
2 changed files with 6 additions and 2 deletions
+2 -1
View File
@@ -104,7 +104,8 @@ class block_course_overview_renderer extends plugin_renderer_base {
$html .= html_writer::end_tag('div');
}
$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);
+4 -1
View File
@@ -2358,6 +2358,7 @@ class global_navigation extends navigation_node {
$issite = ($course->id == $SITE->id);
$shortname = format_string($course->shortname, true, array('context' => $coursecontext));
$fullname = format_string($course->fullname, true, array('context' => $coursecontext));
if ($issite) {
$parent = $this;
@@ -2396,7 +2397,9 @@ class global_navigation extends navigation_node {
$coursenode = $parent->add($shortname, $url, self::TYPE_COURSE, $shortname, $course->id);
$coursenode->nodetype = self::NODETYPE_BRANCH;
$coursenode->hidden = (!$course->visible);
$coursenode->title(format_string($course->fullname, true, array('context' => context_course::instance($course->id))));
// 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;
}