From 38224895f3921dec42c7f20f966fd12ffef8646a Mon Sep 17 00:00:00 2001 From: Will Hunt Date: Mon, 21 Jul 2025 14:56:41 +0100 Subject: [PATCH] Add a comment --- src/UrlParams.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/UrlParams.ts b/src/UrlParams.ts index 3b55ed2a..308d9892 100644 --- a/src/UrlParams.ts +++ b/src/UrlParams.ts @@ -389,6 +389,8 @@ export function getRoomIdentifierFromUrl( let roomId: string | null = parser.getParam("roomId"); if (roomId !== null) { // Replace any non-printable characters that another client may have inserted. + // For instance on iOS, some copied links end up with zero width characters on the end which get encoded into the URL. + // This isn't valid for a roomId, so we can freely strip the content. roomId = roomId.replaceAll(/^[^ -~]+|[^ -~]+$/g, ""); if (!roomId.startsWith("!")) { roomId = null;