Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MDL-10234

Encoded images in subdirectories failed to load.
Thanks to Enrique Castro for fix.
  • Loading branch information...
commit 9259bf1c0ed4a7105686771e6830e6b7c4e64734 1 parent 9407c07
thepurpleblob authored
Showing with 4 additions and 0 deletions.
  1. +4 −0 question/format.php
View
4 question/format.php
@@ -364,6 +364,9 @@ function importimagefile( $path, $base64 ) {
$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];
@@ -382,6 +385,7 @@ function importimagefile( $path, $base64 ) {
fclose( $fh );
// return the (possibly) new filename
+ $newfile = ereg_replace("{$CFG->dataroot}/{$this->course->id}/", '',$newfullpath);
return $newfile;
}
Please sign in to comment.
Something went wrong with that request. Please try again.