From cd495bf9ba47b606c1258f2ab07907b65f5951b7 Mon Sep 17 00:00:00 2001
From: Thomas Mueller <thomas.mueller@tmit.eu>
Date: Thu, 22 Nov 2012 11:22:16 +0100
Subject: [PATCH] some more invalid characters have been added

---
 apps/files/js/files.js | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)

diff --git a/apps/files/js/files.js b/apps/files/js/files.js
index b8972bed6b..8d0f9e06ad 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;
-- 
GitLab