Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
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...
commit ba42721ca4faf56c4a346803456b5a506cd1687c 1 parent 2b3dbc7
@pauln pauln authored
Showing with 2 additions and 1 deletion.
  1. +2 −1  backup/converter/moodle1/lib.php
View
3  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);
Please sign in to comment.
Something went wrong with that request. Please try again.