Fix incorrectly parsed mxid (#2452)

This commit is contained in:
Ajay Bura 2025-08-19 18:06:57 +05:30 committed by GitHub
parent abd713d693
commit 789da641c1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -23,7 +23,7 @@ const DOMAIN_REGEX = /\b(?:[a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}\b/;
export const isServerName = (serverName: string): boolean => DOMAIN_REGEX.test(serverName); export const isServerName = (serverName: string): boolean => DOMAIN_REGEX.test(serverName);
const matchMxId = (id: string): RegExpMatchArray | null => id.match(/^([@$+#])(.+):(\S+)$/); const matchMxId = (id: string): RegExpMatchArray | null => id.match(/^([@$+#])([^\s:]+):(\S+)$/);
const validMxId = (id: string): boolean => !!matchMxId(id); const validMxId = (id: string): boolean => !!matchMxId(id);