From 53938f7998e8c1f0e65de4e06e112ce2d8bada42 Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Tue, 31 Oct 2017 10:25:06 +0000 Subject: [PATCH 1/3] Change client-side validation of group IDs to match synapse --- src/components/views/dialogs/CreateGroupDialog.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/views/dialogs/CreateGroupDialog.js b/src/components/views/dialogs/CreateGroupDialog.js index bda298ef0b..f38d92b482 100644 --- a/src/components/views/dialogs/CreateGroupDialog.js +++ b/src/components/views/dialogs/CreateGroupDialog.js @@ -55,8 +55,8 @@ export default React.createClass({ _checkGroupId: function(e) { let error = null; - if (!/^[a-zA-Z0-9]*$/.test(this.state.groupId)) { - error = _t("Community IDs may only contain alphanumeric characters"); + if (!/^[a-z0-9=_-\.\/]*$/.test(this.state.groupId)) { + error = _t("Community IDs may only contain characters a-z, 0-9, or '=_-./'"); } this.setState({ groupIdError: error, From f53a12d904330cc11deec370434dcd6f8daa9f5a Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Tue, 31 Oct 2017 10:25:48 +0000 Subject: [PATCH 2/3] Generate en_EN translations --- src/i18n/strings/en_EN.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index a541e9e130..bffe3b3264 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -152,7 +152,6 @@ "%(widgetName)s widget removed by %(senderName)s": "%(widgetName)s widget removed by %(senderName)s", "Communities": "Communities", "Message Pinning": "Message Pinning", - "Mention": "Mention", "%(displayName)s is typing": "%(displayName)s is typing", "%(names)s and one other are typing": "%(names)s and one other are typing", "%(names)s and %(count)s others are typing|other": "%(names)s and %(count)s others are typing", @@ -240,6 +239,7 @@ "Unignore": "Unignore", "Ignore": "Ignore", "Jump to read receipt": "Jump to read receipt", + "Mention": "Mention", "Invite": "Invite", "User Options": "User Options", "Direct chats": "Direct chats", @@ -488,6 +488,7 @@ "Identity server URL": "Identity server URL", "What does this mean?": "What does this mean?", "Remove from community": "Remove from community", + "Failed to withdraw invitation": "Failed to withdraw invitation", "Failed to remove user from community": "Failed to remove user from community", "Filter community members": "Filter community members", "Filter community rooms": "Filter community rooms", @@ -588,7 +589,7 @@ "Confirm Removal": "Confirm Removal", "Are you sure you wish to remove (delete) this event? Note that if you delete a room name or topic change, it could undo the change.": "Are you sure you wish to remove (delete) this event? Note that if you delete a room name or topic change, it could undo the change.", "%(actionVerb)s this person?": "%(actionVerb)s this person?", - "Community IDs may only contain alphanumeric characters": "Community IDs may only contain alphanumeric characters", + "Community IDs may only contain characters a-z, 0-9, or '=_-./'": "Community IDs may only contain characters a-z, 0-9, or '=_-./'", "Something went wrong whilst creating your community": "Something went wrong whilst creating your community", "Create Community": "Create Community", "Community Name": "Community Name", From 302bd6c3e97862f1dddaf68b9a51e510c11a2510 Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Tue, 31 Oct 2017 11:48:56 +0000 Subject: [PATCH 3/3] Escape dash in regex --- src/components/views/dialogs/CreateGroupDialog.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/views/dialogs/CreateGroupDialog.js b/src/components/views/dialogs/CreateGroupDialog.js index f38d92b482..12f419ddd6 100644 --- a/src/components/views/dialogs/CreateGroupDialog.js +++ b/src/components/views/dialogs/CreateGroupDialog.js @@ -55,7 +55,7 @@ export default React.createClass({ _checkGroupId: function(e) { let error = null; - if (!/^[a-z0-9=_-\.\/]*$/.test(this.state.groupId)) { + if (!/^[a-z0-9=_\-\.\/]*$/.test(this.state.groupId)) { error = _t("Community IDs may only contain characters a-z, 0-9, or '=_-./'"); } this.setState({