From cd4a7c2f4b453f083324d39a6be21623fd9d77e2 Mon Sep 17 00:00:00 2001 From: Rodrigo Nascimento Date: Fri, 14 Jul 2017 16:29:35 -0300 Subject: [PATCH] Merge pull request #7394 from RocketChat/fix-create-room-slashcommand [FIX] Use UTF8 setting for /create command --- packages/rocketchat-slashcommands-create/server.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/rocketchat-slashcommands-create/server.js b/packages/rocketchat-slashcommands-create/server.js index 4c1ed3963259..a64262065c95 100644 --- a/packages/rocketchat-slashcommands-create/server.js +++ b/packages/rocketchat-slashcommands-create/server.js @@ -12,12 +12,13 @@ function Create(command, params, item) { return result; } - const regexp = /#?([\d-_\w]+)/g; + const regexp = new RegExp(RocketChat.settings.get('UTF8_Names_Validation')); + if (command !== 'create' || !Match.test(params, String)) { return; } let channel = regexp.exec(params.trim()); - channel = channel ? channel[1] : ''; + channel = channel ? channel[0] : ''; if (channel === '') { return; }