diff options
author | Artur Neumann <info@individual-it.net> | 2017-04-05 12:57:41 +0545 |
---|---|---|
committer | Artur Neumann <info@individual-it.net> | 2017-04-05 13:26:40 +0545 |
commit | 3795636b9073a2204036bfe2b581acb187dfcba6 (patch) | |
tree | 26bb843c3b9afa6d93a53adce96e53de9a890705 /apps/files_sharing | |
parent | 84035862f7239e5d05ac0ab848442c9230ad7efc (diff) | |
download | nextcloud-server-3795636b9073a2204036bfe2b581acb187dfcba6.tar.gz nextcloud-server-3795636b9073a2204036bfe2b581acb187dfcba6.zip |
validate file name before uploading in upload only folder
fixes #4211
Signed-off-by: Artur Neumann <info@individual-it.net>
Diffstat (limited to 'apps/files_sharing')
-rw-r--r-- | apps/files_sharing/js/files_drop.js | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/apps/files_sharing/js/files_drop.js b/apps/files_sharing/js/files_drop.js index 64051844d03..ba5bd82cc49 100644 --- a/apps/files_sharing/js/files_drop.js +++ b/apps/files_sharing/js/files_drop.js @@ -46,7 +46,14 @@ var errors = []; var name = data.files[0].name; - + try { + // FIXME: not so elegant... need to refactor that method to return a value + Files.isFileNameValid(name); + } + catch (errorMessage) { + OC.Notification.show(errorMessage, {type: 'error'}); + return false; + } var base = OC.getProtocol() + '://' + OC.getHost(); data.url = base + OC.getRootPath() + '/public.php/webdav/' + encodeURI(name); |