diff options
author | Evilham <github@evilham.com> | 2019-03-13 22:06:05 +0100 |
---|---|---|
committer | Evilham <github@evilham.com> | 2019-03-13 22:21:32 +0100 |
commit | de648f6a3e0025262155aeffa689738901a72dfc (patch) | |
tree | d134ddacb6fe451e3bda145e30fc841359e8552f /apps/files/js/file-upload.js | |
parent | ac10ff01cf87047aab8eaf06a43f088bb7d31910 (diff) | |
download | nextcloud-server-de648f6a3e0025262155aeffa689738901a72dfc.tar.gz nextcloud-server-de648f6a3e0025262155aeffa689738901a72dfc.zip |
[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.
Diffstat (limited to 'apps/files/js/file-upload.js')
-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 a56668c493f..7681de9bf38 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; |