MDL-47371 mod_book: Fix out of scope $unescapedtitle
authorCameron Ball <cameron@moodle.com>
Wed, 13 Jul 2016 02:24:58 +0000 (10:24 +0800)
committerCameron Ball <cameron@moodle.com>
Wed, 13 Jul 2016 02:26:24 +0000 (10:26 +0800)
mod/book/locallib.php

index bb46c01..0cfe192 100644 (file)
@@ -331,6 +331,7 @@ function book_get_toc($chapters, $chapter, $book, $cm, $edit) {
         $toc .= html_writer::start_tag('ul');
         foreach ($chapters as $ch) {
             $title = trim(format_string($ch->title, true, array('context'=>$context)));
+            $titleunescaped = trim(format_string($ch->title, true, array('context' => $context, 'escape' => false)));
             if (!$ch->hidden) {
                 if (!$ch->subchapter) {
                     $nch++;