Skip to content

Commit

Permalink
MDL-39491 Fix order of Workshop submission text processing
Browse files Browse the repository at this point in the history
The order of format_text() and file_rewrite_pluginfile_urls() is
important to make filters work correctly.
  • Loading branch information
mudrd8mz committed May 3, 2013
1 parent 43ded67 commit fb1cb65
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions mod/workshop/renderer.php
Expand Up @@ -132,9 +132,9 @@ protected function render_workshop_submission(workshop_submission $submission) {


$o .= $this->output->container_end(); // end of header $o .= $this->output->container_end(); // end of header


$content = format_text($submission->content, $submission->contentformat, array('overflowdiv'=>true)); $content = file_rewrite_pluginfile_urls($submission->content, 'pluginfile.php', $this->page->context->id,
$content = file_rewrite_pluginfile_urls($content, 'pluginfile.php', $this->page->context->id,
'mod_workshop', 'submission_content', $submission->id); 'mod_workshop', 'submission_content', $submission->id);
$content = format_text($content, $submission->contentformat, array('overflowdiv'=>true));
if (!empty($content)) { if (!empty($content)) {
if (!empty($CFG->enableplagiarism)) { if (!empty($CFG->enableplagiarism)) {
require_once($CFG->libdir.'/plagiarismlib.php'); require_once($CFG->libdir.'/plagiarismlib.php');
Expand Down Expand Up @@ -232,9 +232,9 @@ protected function render_workshop_example_submission(workshop_example_submissio
$o .= $this->output->heading(format_string($example->title), 3, 'title'); $o .= $this->output->heading(format_string($example->title), 3, 'title');
$o .= $this->output->container_end(); // end of header $o .= $this->output->container_end(); // end of header


$content = format_text($example->content, $example->contentformat, array('overflowdiv'=>true)); $content = file_rewrite_pluginfile_urls($example->content, 'pluginfile.php', $this->page->context->id,
$content = file_rewrite_pluginfile_urls($content, 'pluginfile.php', $this->page->context->id,
'mod_workshop', 'submission_content', $example->id); 'mod_workshop', 'submission_content', $example->id);
$content = format_text($content, $example->contentformat, array('overflowdiv'=>true));
$o .= $this->output->container($content, 'content'); $o .= $this->output->container($content, 'content');


$o .= $this->helper_submission_attachments($example->id, 'html'); $o .= $this->helper_submission_attachments($example->id, 'html');
Expand Down

0 comments on commit fb1cb65

Please sign in to comment.