From b908e2fcd9c1c422d0e96e637aa90c31736b3520 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Mudr=C3=A1k?= Date: Fri, 3 May 2013 11:43:03 +0200 Subject: [PATCH] MDL-39491 Fix order of Workshop submission text processing The order of format_text() and file_rewrite_pluginfile_urls() is important to make filters work correctly. --- mod/workshop/renderer.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/mod/workshop/renderer.php b/mod/workshop/renderer.php index eeee5ad59a9..088f6a5e8f6 100644 --- a/mod/workshop/renderer.php +++ b/mod/workshop/renderer.php @@ -131,9 +131,10 @@ class mod_workshop_renderer extends plugin_renderer_base { $o .= $this->output->container_end(); // end of header - $content = format_text($submission->content, $submission->contentformat, array('overflowdiv'=>true)); - $content = file_rewrite_pluginfile_urls($content, 'pluginfile.php', $this->page->context->id, + $content = file_rewrite_pluginfile_urls($submission->content, 'pluginfile.php', $this->page->context->id, 'mod_workshop', 'submission_content', $submission->id); + $content = format_text($content, $submission->contentformat, array('overflowdiv'=>true)); + $o .= $this->output->container($content, 'content'); $o .= $this->helper_submission_attachments($submission->id, 'html'); @@ -222,9 +223,9 @@ class mod_workshop_renderer extends plugin_renderer_base { $o .= $this->output->heading(format_string($example->title), 3, 'title'); $o .= $this->output->container_end(); // end of header - $content = format_text($example->content, $example->contentformat, array('overflowdiv'=>true)); - $content = file_rewrite_pluginfile_urls($content, 'pluginfile.php', $this->page->context->id, + $content = file_rewrite_pluginfile_urls($example->content, 'pluginfile.php', $this->page->context->id, 'mod_workshop', 'submission_content', $example->id); + $content = format_text($content, $example->contentformat, array('overflowdiv'=>true)); $o .= $this->output->container($content, 'content'); $o .= $this->helper_submission_attachments($example->id, 'html');