Permalink
Browse files

Merge commit 'FETCH_HEAd' into MOODLE_21_STABLE

  • Loading branch information...
2 parents 2fff961 + ba0f247 commit 7708c82e72a8f9c1a3cfbd809c0546a51be0e54e Sam Hemelryk committed Nov 29, 2011
Showing with 3 additions and 2 deletions.
  1. +3 −2 question/format/xml/format.php
@@ -184,9 +184,10 @@ public function import_headers($question) {
$data = new stdClass();
$data->content = $filedata;
$data->encoding = 'base64';
- $data->name = $filename;
+ // Question file areas don't support subdirs, so convert path to filename if necessary.
+ $data->name = clean_param(str_replace('/', '_', $filename), PARAM_FILE);
$qo->questiontextfiles[] = $data;
- $qo->questiontext .= ' <img src="@@PLUGINFILE@@/' . $filename . '" />';
+ $qo->questiontext .= ' <img src="@@PLUGINFILE@@/' . $data->name . '" />';
}
// restore files in generalfeedback

0 comments on commit 7708c82

Please sign in to comment.