diff options
author | Bjoern Schiessle <schiessle@owncloud.com> | 2014-03-04 16:42:40 +0100 |
---|---|---|
committer | Bjoern Schiessle <schiessle@owncloud.com> | 2014-03-05 13:16:25 +0100 |
commit | 2e73c957e5b3ae4030e41520088fb078354ae8b1 (patch) | |
tree | 7c6243510a969fc370141f452f3e8575b09db316 /apps/files/js/files.js | |
parent | 79ae3c4527b492bee76b2951ca14e8259147b181 (diff) | |
download | nextcloud-server-2e73c957e5b3ae4030e41520088fb078354ae8b1.tar.gz nextcloud-server-2e73c957e5b3ae4030e41520088fb078354ae8b1.zip |
don't allow to create a file or folder named 'Shared' in the root folder, also exclude all combinations of lower and upper case letters
Diffstat (limited to 'apps/files/js/files.js')
-rw-r--r-- | apps/files/js/files.js | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/apps/files/js/files.js b/apps/files/js/files.js index f4546120702..48e5771ae8a 100644 --- a/apps/files/js/files.js +++ b/apps/files/js/files.js @@ -87,9 +87,12 @@ var Files = { * Throws a string exception with an error message if * the file name is not valid */ - isFileNameValid: function (name) { + isFileNameValid: function (name, root) { var trimmedName = name.trim(); - if (trimmedName === '.' || trimmedName === '..') { + if (trimmedName === '.' + || trimmedName === '..' + || (root === '/' && trimmedName.toLowerCase() === 'shared')) + { throw t('files', '"{name}" is an invalid file name.', {name: name}); } else if (trimmedName.length === 0) { throw t('files', 'File name cannot be empty.'); |