Show warning if slash is entered as filename

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
This commit is contained in:
Morris Jobke 2018-01-03 11:42:49 +01:00
parent 86d33cf50f
commit 31c0efc299
No known key found for this signature in database
GPG Key ID: FE03C3A163FEDE68
1 changed files with 2 additions and 0 deletions

View File

@ -128,6 +128,8 @@
throw t('files', '"{name}" is an invalid file name.', {name: name});
} else if (trimmedName.length === 0) {
throw t('files', 'File name cannot be empty.');
} else if (trimmedName.indexOf('/') !== -1) {
throw t('files', '"/" is not allowed inside a file name.');
} else if (OC.fileIsBlacklisted(trimmedName)) {
throw t('files', '"{name}" is not an allowed filetype', {name: name});
}