diff --git a/i18n/en.i18n.json b/i18n/en.i18n.json
index 5568cafba6d1..d5e9c678042e 100755
--- a/i18n/en.i18n.json
+++ b/i18n/en.i18n.json
@@ -40,6 +40,8 @@
"Created_at" : "Created at",
"Direct_Messages" : "Direct Messages",
"Deleted" : "Deleted!",
+ "Duplicate_private_group_name" : "A Private Group with the name, '%s', exists",
+ "Duplicate_channel_name" : "A Channel with the name, '%s', exists",
"edited" : "edited",
"Email_or_username" : "Email or username",
"Email_verified" : "Email verified",
diff --git a/server/methods/createChannel.coffee b/server/methods/createChannel.coffee
index e3838f42470f..8b80d937b9e1 100644
--- a/server/methods/createChannel.coffee
+++ b/server/methods/createChannel.coffee
@@ -15,7 +15,7 @@ Meteor.methods
# avoid duplicate names
if ChatRoom.findOne({name:name})
- throw new Meteor.Error 'duplicate-name', "A Channel with the same name exists"
+ throw new Meteor.Error 'duplicate-name'
# name = s.slugify name
diff --git a/server/methods/createPrivateGroup.coffee b/server/methods/createPrivateGroup.coffee
index ef8d8ba4315a..40d252a649d2 100644
--- a/server/methods/createPrivateGroup.coffee
+++ b/server/methods/createPrivateGroup.coffee
@@ -5,6 +5,9 @@ Meteor.methods
console.log '[methods] createPrivateGroup -> '.green, 'userId:', Meteor.userId(), 'arguments:', arguments
+ if not /^[0-9a-z-_]+$/i.test name
+ throw new Meteor.Error 'name-invalid'
+
now = new Date()
me = Meteor.user()
@@ -15,7 +18,7 @@ Meteor.methods
# avoid duplicate names
if ChatRoom.findOne({name:name})
- throw new Meteor.Error 'duplicate-name', "A private group with the same name exists"
+ throw new Meteor.Error 'duplicate-name'
# create new room
rid = ChatRoom.insert