diff options
author | Robin Appelman <icewind@owncloud.com> | 2012-11-23 16:20:56 +0100 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2012-11-23 16:20:56 +0100 |
commit | 555dec2d92316e47edd775d4e63ffe60fb0eca6b (patch) | |
tree | 7cde08c5ce382fae2acdd2434b208ca956d48ec8 /apps/files/js/files.js | |
parent | 95057e727d438098bec050baf997a7489563a04e (diff) | |
parent | 67f9f079ae848116d5eb4306d35456fe0e34f5e4 (diff) | |
download | nextcloud-server-555dec2d92316e47edd775d4e63ffe60fb0eca6b.tar.gz nextcloud-server-555dec2d92316e47edd775d4e63ffe60fb0eca6b.zip |
merge master into filesystem
Diffstat (limited to 'apps/files/js/files.js')
-rw-r--r-- | apps/files/js/files.js | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/apps/files/js/files.js b/apps/files/js/files.js index 4307650d4ff..3b33fc19780 100644 --- a/apps/files/js/files.js +++ b/apps/files/js/files.js @@ -25,6 +25,18 @@ Files={ delete uploadingFiles[index]; }); procesSelection(); + }, + containsInvalidCharacters:function (name) { + var invalid_characters = ['\\', '/', '<', '>', ':', '"', '|', '?', '*']; + for (var i = 0; i < invalid_characters.length; i++) { + if (name.indexOf(invalid_characters[i]) != -1) { + $('#notification').text(t('files', "Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed.")); + $('#notification').fadeIn(); + return true; + } + } + $('#notification').fadeOut(); + return false; } }; $(document).ready(function() { @@ -505,9 +517,7 @@ $(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')); |