Permalink
Browse files

Merge branch 'wip-MDL-38055-m23' of git://github.com/samhemelryk/mood…

…le into MOODLE_23_STABLE
  • Loading branch information...
2 parents 770e8c0 + 4688b27 commit 35c4301b2c081364ec3148120e0c349130d63ee9 @damyon damyon committed Apr 16, 2013
Showing with 7 additions and 2 deletions.
  1. +3 −1 course/lib.php
  2. +4 −1 lib/navigationlib.php
View
@@ -857,7 +857,9 @@ function print_overview($courses, array $remote_courses=array()) {
foreach ($courses as $course) {
$fullname = format_string($course->fullname, true, array('context' => get_context_instance(CONTEXT_COURSE, $course->id)));
echo $OUTPUT->box_start('coursebox');
- $attributes = array('title' => s($fullname));
+ // decode &'s. format_string above will have encoded them and html_writer will encode again when it processed the title
+ // attribute leading to double encoding.
+ $attributes = array('title' => str_replace('&', '&', $fullname));
if (empty($course->visible)) {
$attributes['class'] = 'dimmed';
}
View
@@ -2530,6 +2530,7 @@ public function add_course(stdClass $course, $forcegeneric = false, $ismycourse
$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;
@@ -2565,7 +2566,9 @@ public function add_course(stdClass $course, $forcegeneric = false, $ismycourse
$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' => get_context_instance(CONTEXT_COURSE, $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;
}

0 comments on commit 35c4301

Please sign in to comment.