]> source.dussan.org Git - nextcloud-server.git/commitdiff
Merge pull request #480 from owncloud/fix_435_and_437
authorThomas Müller <thomas.mueller@tmit.eu>
Fri, 23 Nov 2012 11:05:52 +0000 (03:05 -0800)
committerThomas Müller <thomas.mueller@tmit.eu>
Fri, 23 Nov 2012 11:05:52 +0000 (03:05 -0800)
Also reject names with \ in the name

1  2 
apps/files/js/files.js

index 2b250e0c7c5df20216bcf7da5d3bc0b2e50953da,9fa2a384b5d20450afaf7b38230f8d7011a952cb..28d4b49670d8d0771d0c760495a4c1dc31f4b1f2
@@@ -505,14 -517,8 +517,12 @@@ $(document).ready(function() 
                $(this).append(input);
                input.focus();
                input.change(function(){
-                       if(type != 'web' && $(this).val().indexOf('/')!=-1){
-                               $('#notification').text(t('files','Invalid name, \'/\' is not allowed.'));
-                               $('#notification').fadeIn();
+                       if (type != 'web' && Files.containsInvalidCharacters($(this).val())) {
                                return;
 +                      } else if( type == 'folder' && $('#dir').val() == '/' && $(this).val() == 'Shared') {
 +                              $('#notification').text(t('files','Invalid folder name. Usage of "Shared" is reserved by Owncloud'));
 +                              $('#notification').fadeIn();
 +                              return;
                        }
                        var name = getUniqueName($(this).val());
                        if (name != $(this).val()) {