From e0f82479af17cdb41855f7d28978c42d4b15bb98 Mon Sep 17 00:00:00 2001 From: Gabriel Engel Date: Sat, 23 Sep 2017 15:36:45 -0300 Subject: [PATCH] Merge pull request #8237 from matheusml/fix-8168 [FIX] Removing pipe and commas from custom emojis (#8168) --- .../server/methods/insertOrUpdateEmoji.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/packages/rocketchat-emoji-custom/server/methods/insertOrUpdateEmoji.js b/packages/rocketchat-emoji-custom/server/methods/insertOrUpdateEmoji.js index b373348ef4b7..ef7ad08401c8 100644 --- a/packages/rocketchat-emoji-custom/server/methods/insertOrUpdateEmoji.js +++ b/packages/rocketchat-emoji-custom/server/methods/insertOrUpdateEmoji.js @@ -9,13 +9,10 @@ Meteor.methods({ throw new Meteor.Error('error-the-field-is-required', 'The field Name is required', { method: 'insertOrUpdateEmoji', field: 'Name' }); } - //let nameValidation = new RegExp('^[0-9a-zA-Z-_+;.]+$'); - //let aliasValidation = new RegExp('^[0-9a-zA-Z-_+;., ]+$'); - //allow all characters except colon, whitespace, comma, >, <, &, ", ', /, \, (, ) //more practical than allowing specific sets of characters; also allows foreign languages const nameValidation = /[\s,:><&"'\/\\\(\)]/; - const aliasValidation = /[:><&"'\/\\\(\)]/; + const aliasValidation = /[:><&\|"'\/\\\(\)]/; //silently strip colon; this allows for uploading :emojiname: as emojiname emojiData.name = emojiData.name.replace(/:/g, '');