Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvilham <github@evilham.com>2019-03-14 00:06:05 +0300
committerEvilham <github@evilham.com>2019-03-14 00:21:32 +0300
commitde648f6a3e0025262155aeffa689738901a72dfc (patch)
treed134ddacb6fe451e3bda145e30fc841359e8552f /apps/files/js/file-upload.js
parentac10ff01cf87047aab8eaf06a43f088bb7d31910 (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.
Diffstat (limited to 'apps/files/js/file-upload.js')
-rw-r--r--apps/files/js/file-upload.js7
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;