diff --git a/backup/converter/moodle1/lib.php b/backup/converter/moodle1/lib.php index 3b3fd4af61e..da6a4ec9ab1 100644 --- a/backup/converter/moodle1/lib.php +++ b/backup/converter/moodle1/lib.php @@ -1274,6 +1274,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(); }