diff --git a/mod/book/tool/print/classes/output/print_book_page.php b/mod/book/tool/print/classes/output/print_book_page.php index 3dd593678aa..5cb3653fa06 100644 --- a/mod/book/tool/print/classes/output/print_book_page.php +++ b/mod/book/tool/print/classes/output/print_book_page.php @@ -79,7 +79,8 @@ class print_book_page implements renderable, templatable { $data->printdialoglink = $output->render_print_book_dialog_link(); $data->booktitle = $OUTPUT->heading(format_string($this->book->name, true, array('context' => $context)), 1); - $data->bookintro = format_text($this->book->intro, $this->book->introformat, + $introtext = file_rewrite_pluginfile_urls($this->book->intro, 'pluginfile.php', $context->id, 'mod_book', 'intro', null); + $data->bookintro = format_text($introtext, $this->book->introformat, array('noclean' => true, 'context' => $context)); $data->sitelink = \html_writer::link(new moodle_url($CFG->wwwroot), format_string($SITE->fullname, true, array('context' => $context))); diff --git a/mod/book/tool/print/classes/output/renderer.php b/mod/book/tool/print/classes/output/renderer.php index d94622df736..632b35ecc49 100644 --- a/mod/book/tool/print/classes/output/renderer.php +++ b/mod/book/tool/print/classes/output/renderer.php @@ -200,7 +200,9 @@ class renderer extends plugin_renderer_base { } } - $bookchapter .= format_text($chapter->content, $chapter->contentformat, array('noclean' => true, 'context' => $context)); + $chaptertext = file_rewrite_pluginfile_urls($chapter->content, 'pluginfile.php', $context->id, + 'mod_book', 'chapter', $chapter->id); + $bookchapter .= format_text($chaptertext, $chapter->contentformat, array('noclean' => true, 'context' => $context)); $bookchapter .= html_writer::end_div(); return array($bookchapter, $chaptervisible);