summaryrefslogtreecommitdiffstats
path: root/apps/files/js/files.js
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2014-03-06 00:15:08 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2014-03-06 00:15:08 +0100
commit32b29c9d735ae235641a7ea3869c14d7eb69cb4f (patch)
tree63e4e269bd33b0688965c9b3b1059466a8f502b8 /apps/files/js/files.js
parent6de370b64cb8f7fcd9d3bd090b8d801d91d2fcca (diff)
parent1785c0c9b9fcdc6e9a8e58f13f45e5b53364882a (diff)
downloadnextcloud-server-32b29c9d735ae235641a7ea3869c14d7eb69cb4f.tar.gz
nextcloud-server-32b29c9d735ae235641a7ea3869c14d7eb69cb4f.zip
Merge branch 'master' into fix-7307
Conflicts: core/js/router.js settings/js/admin.js
Diffstat (limited to 'apps/files/js/files.js')
-rw-r--r--apps/files/js/files.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/apps/files/js/files.js b/apps/files/js/files.js
index c93862e85d8..1186a72a44f 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.');