Merge pull request #248 from matrix-org/url-escape-fragment

Apply URL encoding to the fragmentPath
This commit is contained in:
Bruno Windels 2021-11-24 09:40:31 +01:00 committed by GitHub
commit ded399d35d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -72,11 +72,11 @@ 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}/#/${fragmentPath}`; return `https://${instanceHost}/#/${encodeURIComponent(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/#/${fragmentPath}`; return `element://vector/webapp/#/${encodeURIComponent(fragmentPath)}`;
} else { } else {
return `element://${fragmentPath}`; return `element://${encodeURIComponent(fragmentPath)}`;
} }
} }