Fix incorrectly parsed mxid (#2452)
authorAjay Bura <32841439+ajbura@users.noreply.github.com>
Tue, 19 Aug 2025 12:36:57 +0000 (18:06 +0530)
committerGitHub <noreply@github.com>
Tue, 19 Aug 2025 12:36:57 +0000 (22:36 +1000)
src/app/utils/matrix.ts

index c8b104d987767192f596aa455c78011031062cc1..b4e2e6b8de1c2c61ffb8a296cdf24928e0b01054 100644 (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);
 
-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);