Permalink
Browse files

MDL-36204: moodle1 backup converter: urldecode filenames from links

If filenames are not run through urldecode(), those that contain spaces (or other url-encoded characters) will not be handled, as they can't be found in the backup file.
  • Loading branch information...
pauln committed Oct 25, 2012
1 parent ff63a3a commit 0dfc910131dc04a1738530fd2f23e4285675e099
Showing with 2 additions and 1 deletion.
  1. +2 −1 backup/converter/moodle1/lib.php
@@ -640,7 +640,8 @@ public static function find_referenced_files($text) {
return $files;
}
foreach ($matches[2] as $match) {
$files[] = str_replace(array('$@FILEPHP@$', '$@SLASH@$', '$@FORCEDOWNLOAD@$'), array('', '/', ''), $match);
$file = str_replace(array('$@FILEPHP@$', '$@SLASH@$', '$@FORCEDOWNLOAD@$'), array('', '/', ''), $match);
$files[] = urldecode($file);
}
return array_unique($files);

0 comments on commit 0dfc910

Please sign in to comment.