Skip to content

Commit

Permalink
Merge pull request #7394 from RocketChat/fix-create-room-slashcommand
Browse files Browse the repository at this point in the history
[FIX] Use UTF8 setting for /create command
  • Loading branch information
rodrigok committed Aug 8, 2017
1 parent cfa26a9 commit cd4a7c2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/rocketchat-slashcommands-create/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit cd4a7c2

Please sign in to comment.