diff --git a/blocks/course_overview/renderer.php b/blocks/course_overview/renderer.php index acf44a04030..8c424281c64 100644 --- a/blocks/course_overview/renderer.php +++ b/blocks/course_overview/renderer.php @@ -104,12 +104,11 @@ class block_course_overview_renderer extends plugin_renderer_base { $html .= html_writer::end_tag('div'); } - $context = context_course::instance($course->id); - $fullname = format_string($course->fullname, true, array('context' => $context)); - $attributes = array('title' => str_replace('&', '&', $fullname)); + $attributes = array('title' => s($course->fullname)); if ($course->id > 0) { $courseurl = new moodle_url('/course/view.php', array('id' => $course->id)); - $link = html_writer::link($courseurl, $fullname, $attributes); + $coursefullname = format_string($course->fullname, true, $course->id); + $link = html_writer::link($courseurl, $coursefullname, $attributes); $html .= $this->output->heading($link, 2, 'title'); } else { $html .= $this->output->heading(html_writer::link( diff --git a/lib/navigationlib.php b/lib/navigationlib.php index 1c9f54eae1e..6b1c192641f 100644 --- a/lib/navigationlib.php +++ b/lib/navigationlib.php @@ -2396,8 +2396,7 @@ 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); - $fullname = format_string($course->fullname, true, array('context' => context_course::instance($course->id))); - $coursenode->title(str_replace('&', '&', $fullname)); + $coursenode->title(format_string($course->fullname, true, array('context' => context_course::instance($course->id)))); if (!$forcegeneric) { $this->addedcourses[$course->id] = $coursenode; }