From: thepurpleblob Date: Thu, 28 Jun 2007 15:15:06 +0000 (+0000) Subject: MDL-10234 X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=717357948e0be31289025f1902c791a4f726e6c7;p=moodle.git MDL-10234 Encoded images in subdirectories failed to load. Thanks to Enrique Castro for fix. --- diff --git a/question/format.php b/question/format.php index 7d00f0852c..95f0a74851 100644 --- a/question/format.php +++ b/question/format.php @@ -365,6 +365,9 @@ class qformat_default { $destination = $path_parts['dirname']; $file = clean_filename( $path_parts['basename'] ); + // check if path exists + check_dir_exists($destination, true, true ); + // detect and fix any filename collision - get unique filename $newfiles = resolve_filename_collisions( $destination, array($file) ); $newfile = $newfiles[0]; @@ -383,6 +386,7 @@ class qformat_default { fclose( $fh ); // return the (possibly) new filename + $newfile = ereg_replace("{$CFG->dataroot}/{$this->course->id}/", '',$newfullpath); return $newfile; }