validate file name before uploading in upload only folder
fixes #4211 Signed-off-by: Artur Neumann <info@individual-it.net>
This commit is contained in:
parent
84035862f7
commit
3795636b90
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue