ensure MXC URLs properly parsed when media IDs contain hypens, fixes #494
This commit is contained in:
parent
61013e1875
commit
54b67b3b48
@ -1,5 +1,5 @@
|
||||
export const getServerAndMediaIdFromMxcUrl = (mxcUrl: string): { serverName: string; mediaId: string } => {
|
||||
const re = /^mxc:\/\/([^/]+)\/(\w+)/;
|
||||
const re = /^mxc:\/\/([^/]+)\/([\w-]+)$/;
|
||||
const ret = re.exec(mxcUrl);
|
||||
if (ret == null) {
|
||||
throw new Error("Invalid mxcUrl");
|
||||
|
Loading…
x
Reference in New Issue
Block a user