[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:
parent
ac10ff01cf
commit
de648f6a3e
1 changed files with 3 additions and 4 deletions
|
@ -34,12 +34,11 @@
|
||||||
OC.FileUpload = function(uploader, data) {
|
OC.FileUpload = function(uploader, data) {
|
||||||
this.uploader = uploader;
|
this.uploader = uploader;
|
||||||
this.data = data;
|
this.data = data;
|
||||||
var path = '';
|
var basePath = '';
|
||||||
if (this.uploader.fileList) {
|
if (this.uploader.fileList) {
|
||||||
path = OC.joinPaths(this.uploader.fileList.getCurrentDirectory(), this.getFile().name);
|
basePath = this.uploader.fileList.getCurrentDirectory();
|
||||||
} else {
|
|
||||||
path = this.getFile().name;
|
|
||||||
}
|
}
|
||||||
|
var path = OC.joinPaths(basePath, this.getFile().relativePath || '', this.getFile().name);
|
||||||
this.id = 'web-file-upload-' + md5(path) + '-' + (new Date()).getTime();
|
this.id = 'web-file-upload-' + md5(path) + '-' + (new Date()).getTime();
|
||||||
};
|
};
|
||||||
OC.FileUpload.CONFLICT_MODE_DETECT = 0;
|
OC.FileUpload.CONFLICT_MODE_DETECT = 0;
|
||||||
|
|
Loading…
Reference in a new issue