From 2e73c957e5b3ae4030e41520088fb078354ae8b1 Mon Sep 17 00:00:00 2001 From: Bjoern Schiessle Date: Tue, 4 Mar 2014 16:42:40 +0100 Subject: 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 --- apps/files/js/filelist.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'apps/files/js/filelist.js') diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index 550c10dba3e..020ee275b7d 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -419,15 +419,12 @@ window.FileList={ len = input.val().length; } input.selectRange(0, len); - var checkInput = function () { var filename = input.val(); if (filename !== oldname) { - if (!Files.isFileNameValid(filename)) { - // Files.isFileNameValid(filename) throws an exception itself - } else if($('#dir').val() === '/' && filename === 'Shared') { - throw t('files','In the home folder \'Shared\' is a reserved filename'); - } else if (FileList.inList(filename)) { + // Files.isFileNameValid(filename) throws an exception itself + Files.isFileNameValid(filename, FileList.getCurrentDirectory()); + if (FileList.inList(filename)) { throw t('files', '{new_name} already exists', {new_name: filename}); } } -- cgit v1.2.3 From 1ab10cb4f7e085f957198e05e727c81b2c9b27a9 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Wed, 5 Mar 2014 18:46:55 +0100 Subject: Do not set #dir when on public.php Fix #7571 --- apps/files/js/filelist.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'apps/files/js/filelist.js') diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js index 550c10dba3e..9a64035d72a 100644 --- a/apps/files/js/filelist.js +++ b/apps/files/js/filelist.js @@ -1156,9 +1156,9 @@ $(document).ready(function() { // need to initially switch the dir to the one from the hash (IE8) FileList.changeDirectory(parseCurrentDirFromUrl(), false, true); } - } - FileList.setCurrentDir(parseCurrentDirFromUrl(), false); + FileList.setCurrentDir(parseCurrentDirFromUrl(), false); + } FileList.createFileSummary(); }); -- cgit v1.2.3