diff --git a/backup/converter/moodle1/lib.php b/backup/converter/moodle1/lib.php index 29521d6016f..29f004d1ffe 100644 --- a/backup/converter/moodle1/lib.php +++ b/backup/converter/moodle1/lib.php @@ -1278,6 +1278,11 @@ class moodle1_file_manager implements loggable { */ public function migrate_directory($rootpath, $relpath='/') { + // Check the trailing slash in the $rootpath + if (substr($rootpath, -1) === '/') { + $rootpath = substr($rootpath, 0, strlen($rootpath) - 1); + } + if (!file_exists($this->basepath.'/'.$rootpath.$relpath)) { return array(); }