From: Thomas Mueller Date: Thu, 22 Nov 2012 10:22:16 +0000 (+0100) Subject: some more invalid characters have been added X-Git-Tag: v5.0.0alpha1~411^2~1 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=cd495bf9ba47b606c1258f2ab07907b65f5951b7;p=nextcloud-server.git some more invalid characters have been added --- 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;