MDL-37774 Do not pass trailing slash if the method does not want it
[moodle.git] / mod / folder / backup / moodle1 / lib.php
index 1e0a73d..b9655a7 100644 (file)
@@ -65,7 +65,11 @@ class moodle1_mod_folder_handler extends moodle1_resource_successor_handler {
         // migrate the folder files
         $this->fileman->filearea = 'content';
         $this->fileman->itemid   = 0;
         // migrate the folder files
         $this->fileman->filearea = 'content';
         $this->fileman->itemid   = 0;
-        $this->fileman->migrate_directory('course_files/'.$data['reference']);
+        if (empty($data['reference'])) {
+            $this->fileman->migrate_directory('course_files');
+        } else {
+            $this->fileman->migrate_directory('course_files/'.$data['reference']);
+        }
 
         // write folder.xml
         $this->open_xml_writer("activities/folder_{$moduleid}/folder.xml");
 
         // write folder.xml
         $this->open_xml_writer("activities/folder_{$moduleid}/folder.xml");