Skip to content

Commit 3795636

Browse files
committed
validate file name before uploading in upload only folder
fixes #4211 Signed-off-by: Artur Neumann <[email protected]>
1 parent 8403586 commit 3795636

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

apps/files_sharing/js/files_drop.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,14 @@
4646
var errors = [];
4747

4848
var name = data.files[0].name;
49-
49+
try {
50+
// FIXME: not so elegant... need to refactor that method to return a value
51+
Files.isFileNameValid(name);
52+
}
53+
catch (errorMessage) {
54+
OC.Notification.show(errorMessage, {type: 'error'});
55+
return false;
56+
}
5057
var base = OC.getProtocol() + '://' + OC.getHost();
5158
data.url = base + OC.getRootPath() + '/public.php/webdav/' + encodeURI(name);
5259

0 commit comments

Comments
 (0)