diff options
author | Evilham <github@evilham.com> | 2019-03-14 00:06:05 +0300 |
---|---|---|
committer | Backportbot <backportbot-noreply@rullzer.com> | 2019-03-20 13:21:21 +0300 |
commit | fad5424165a5015bab6611f11185190ce9500de0 (patch) | |
tree | 74e76016d53db911e517d5bec31b8140e29a7948 | |
parent | d211d5ef57f411a12582c52f521872f6e6550890 (diff) |
[app:files] Use current directory for hashing.
This fixes collisions that were causing uploads to break in a very
terrible way.
Kudos to @kesselb for finding the problematic place and to
@hottwister for the proposed solution.
Fixes #10527.
-rw-r--r-- | apps/files/js/file-upload.js | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/apps/files/js/file-upload.js b/apps/files/js/file-upload.js index 827f1317fb3..47d22447c91 100644 --- a/apps/files/js/file-upload.js +++ b/apps/files/js/file-upload.js @@ -34,12 +34,11 @@ OC.FileUpload = function(uploader, data) { this.uploader = uploader; this.data = data; - var path = ''; + var basePath = ''; if (this.uploader.fileList) { - path = OC.joinPaths(this.uploader.fileList.getCurrentDirectory(), this.getFile().name); - } else { - path = this.getFile().name; + basePath = this.uploader.fileList.getCurrentDirectory(); } + var path = OC.joinPaths(basePath, this.getFile().relativePath || '', this.getFile().name); this.id = 'web-file-upload-' + md5(path) + '-' + (new Date()).getTime(); }; OC.FileUpload.CONFLICT_MODE_DETECT = 0; |