summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2017-08-24 14:55:17 +0200
committerMorris Jobke <hey@morrisjobke.de>2017-08-26 11:30:04 +0200
commit69d2d0178a46b72bea2d4618bbd2f42456b9e761 (patch)
tree8df7cdd05f32a9da3e87f06e0617d31d60678073
parentca490bafb950b9d16ab4543ae810c3a67cb84d5b (diff)
downloadnextcloud-server-69d2d0178a46b72bea2d4618bbd2f42456b9e761.tar.gz
nextcloud-server-69d2d0178a46b72bea2d4618bbd2f42456b9e761.zip
Don't try the actual file upload if the checks already error out
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
-rw-r--r--apps/files/js/file-upload.js3
-rw-r--r--apps/files/js/filelist.js1
-rw-r--r--apps/files/tests/js/filelistSpec.js2
3 files changed, 6 insertions, 0 deletions
diff --git a/apps/files/js/file-upload.js b/apps/files/js/file-upload.js
index 1f99d561a13..b86b42bdb9a 100644
--- a/apps/files/js/file-upload.js
+++ b/apps/files/js/file-upload.js
@@ -1113,6 +1113,9 @@ OC.Uploader.prototype = _.extend({
});
fileupload.on('fileuploaddrop', function(e, data) {
self.trigger('drop', e, data);
+ if (e.isPropagationStopped()) {
+ return false;
+ }
});
}
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index 9bf25c5904d..79ec8e2d9f9 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -2795,6 +2795,7 @@
var isCreatable = (self.getDirectoryPermissions() & OC.PERMISSION_CREATE) !== 0;
if (!isCreatable) {
self._showPermissionDeniedNotification();
+ e.stopPropagation();
return false;
}
diff --git a/apps/files/tests/js/filelistSpec.js b/apps/files/tests/js/filelistSpec.js
index 41d202e9323..a12c0ff49b6 100644
--- a/apps/files/tests/js/filelistSpec.js
+++ b/apps/files/tests/js/filelistSpec.js
@@ -2810,6 +2810,8 @@ describe('OCA.Files.FileList tests', function() {
target: $target
},
preventDefault: function () {
+ },
+ stopPropagation: function() {
}
};
uploader.trigger('drop', eventData, data || {});