From b302bd6829c416a5deb9015a1a125f6ee4919c2a Mon Sep 17 00:00:00 2001 From: James Salter Date: Wed, 24 Nov 2021 17:14:26 +1100 Subject: [PATCH] Apply URL encoding to the fragmentPath According to RFC3986 section 3.5, only certain values are legal in the fragment. # in particular isn't one of them, but this is a character that appears in room names. It shouldn't hurt to escape other, otherwise legal characters in the fragment such as @ and :. --- src/open/clients/Element.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/open/clients/Element.js b/src/open/clients/Element.js index 0d54946..56357db 100644 --- a/src/open/clients/Element.js +++ b/src/open/clients/Element.js @@ -74,9 +74,9 @@ export class Element { } return `https://${instanceHost}/#/${fragmentPath}`; } else if (platform === Platform.Linux || platform === Platform.Windows || platform === Platform.macOS) { - return `element://vector/webapp/#/${fragmentPath}`; + return `element://vector/webapp/#/${encodeURIComponent(fragmentPath)}`; } else { - return `element://${fragmentPath}`; + return `element://${encodeURIComponent(fragmentPath)}`; } }