diff options
author | Thomas Mueller <thomas.mueller@tmit.eu> | 2012-11-22 11:22:16 +0100 |
---|---|---|
committer | Jörn Friedrich Dreyer <jfd@butonic.de> | 2012-11-22 11:52:05 +0100 |
commit | cd495bf9ba47b606c1258f2ab07907b65f5951b7 (patch) | |
tree | f3a0ebb0cc3b2d4099a929037bd9612fb0df1156 | |
parent | 1793e85a523174f66575ca4c40ceecbbe2b1c09d (diff) | |
download | nextcloud-server-cd495bf9ba47b606c1258f2ab07907b65f5951b7.tar.gz nextcloud-server-cd495bf9ba47b606c1258f2ab07907b65f5951b7.zip |
some more invalid characters have been added
-rw-r--r-- | apps/files/js/files.js | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/apps/files/js/files.js b/apps/files/js/files.js index b8972bed6b8..8d0f9e06ad7 100644 --- a/apps/files/js/files.js +++ b/apps/files/js/files.js @@ -505,12 +505,17 @@ $(document).ready(function() { $(this).append(input); input.focus(); input.change(function(){ - if(type != 'web' && ($(this).val().indexOf('/')!=-1 || $(this).val().indexOf('\\')!=-1)) { - $('#notification').text(t('files', 'Invalid name, \'/\' or \'\\\' is not allowed.')); - $('#notification').fadeIn(); - return; - } - var name = getUniqueName($(this).val()); + if (type != 'web') { + var invalid_characters = ['\\', '/', '<', '>', ':', '"', '|', '?', '*']; + for (var i = 0; i < invalid_characters.length; i++) { + if ($(this).val().indexOf(invalid_characters[i]) != -1) { + $('#notification').text(t('files', "Invalid name, '\\', '/', '<', '>', ':', '\"', '|', '?' and '*' are not allowed.")); + $('#notification').fadeIn(); + return; + } + } + } + var name = getUniqueName($(this).val()); if (name != $(this).val()) { FileList.checkName(name, $(this).val(), true); var hidden = true; |