[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.
This commit is contained in:
Evilham 2019-03-13 22:06:05 +01:00
parent ac10ff01cf
commit de648f6a3e

View file

@ -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;