Merge branch 'MDL-54584-master' of git://github.com/andrewnicols/moodle
authorDavid Monllao <davidm@moodle.com>
Mon, 16 May 2016 08:15:03 +0000 (16:15 +0800)
committerDavid Monllao <davidm@moodle.com>
Tue, 17 May 2016 09:16:08 +0000 (17:16 +0800)
repository/lib.php

index f3e8474..297ca6f 100644 (file)
@@ -1617,6 +1617,9 @@ abstract class repository implements cacheable_object {
      * @return file path
      */
     public function prepare_file($filename) {
+        if (empty($filename)) {
+            $filename = 'file';
+        }
         return sprintf('%s/%s', make_request_directory(), $filename);
     }