MDL-37774 Do not pass trailing slash if the method does not want it
authorDavid Mudrák <david@moodle.com>
Fri, 8 Feb 2013 11:05:44 +0000 (12:05 +0100)
committerDavid Mudrák <david@moodle.com>
Fri, 8 Feb 2013 11:05:44 +0000 (12:05 +0100)
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;
-        $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");