aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files/js/files.js
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2014-03-06 13:35:06 +0100
committerRobin Appelman <icewind@owncloud.com>2014-03-06 13:35:06 +0100
commit84cf40ed82417f56586c46317b1280065c7091a6 (patch)
tree2f774fd12de4763b9f2a0f29a7199d2a3b05f14e /apps/files/js/files.js
parenta687498547448d6ff11eccc0acddcf0647873ce8 (diff)
parent1785c0c9b9fcdc6e9a8e58f13f45e5b53364882a (diff)
downloadnextcloud-server-84cf40ed82417f56586c46317b1280065c7091a6.tar.gz
nextcloud-server-84cf40ed82417f56586c46317b1280065c7091a6.zip
merge master into webdav-injection
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 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.');