Skip to content
Snippets Groups Projects
Unverified Commit 58f63c4a authored by Michael Telatynski's avatar Michael Telatynski Committed by GitHub
Browse files

Fix over-encoding issues in Element URIs

parent d7c10858
No related branches found
No related tags found
No related merge requests found
...@@ -52,16 +52,16 @@ export class Element { ...@@ -52,16 +52,16 @@ export class Element {
let fragmentPath; let fragmentPath;
switch (link.kind) { switch (link.kind) {
case LinkKind.User: case LinkKind.User:
fragmentPath = `user/${link.identifier}`; fragmentPath = `user/${encodeURIComponent(link.identifier)}`;
break; break;
case LinkKind.Room: case LinkKind.Room:
fragmentPath = `room/${link.identifier}`; fragmentPath = `room/${encodeURIComponent(link.identifier)}`;
break; break;
case LinkKind.Group: case LinkKind.Group:
fragmentPath = `group/${link.identifier}`; fragmentPath = `group/${encodeURIComponent(link.identifier)}`;
break; break;
case LinkKind.Event: case LinkKind.Event:
fragmentPath = `room/${link.identifier}/${link.eventId}`; fragmentPath = `room/${encodeURIComponent(link.identifier)}/${encodeURIComponent(link.eventId)}`;
break; break;
} }
...@@ -77,9 +77,9 @@ export class Element { ...@@ -77,9 +77,9 @@ export class Element {
if (isWebPlatform && trustedWebInstances.includes(link.webInstances[this.id])) { if (isWebPlatform && trustedWebInstances.includes(link.webInstances[this.id])) {
instanceHost = link.webInstances[this.id]; instanceHost = link.webInstances[this.id];
} }
return `https://${instanceHost}/#/${encodeURIComponent(fragmentPath)}`; return `https://${instanceHost}/#/${fragmentPath}`;
} else if (platform === Platform.Linux || platform === Platform.Windows || platform === Platform.macOS) { } else if (platform === Platform.Linux || platform === Platform.Windows || platform === Platform.macOS) {
return `element://vector/webapp/#/${encodeURIComponent(fragmentPath)}`; return `element://vector/webapp/#/${fragmentPath}`;
} else { } else {
return `element://${fragmentPath}`; return `element://${fragmentPath}`;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment