Skip to content

Commit

Permalink
[app:files] Use current directory for hashing.
Browse files Browse the repository at this point in the history
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 nextcloud#10527.
  • Loading branch information
evilham committed Mar 13, 2019
1 parent ac10ff0 commit de648f6
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions apps/files/js/file-upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit de648f6

Please sign in to comment.