From fad5424165a5015bab6611f11185190ce9500de0 Mon Sep 17 00:00:00 2001 From: Evilham Date: Wed, 13 Mar 2019 22:06:05 +0100 Subject: [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. --- apps/files/js/file-upload.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'apps') 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; -- cgit v1.2.3