Handle BigEmoji permalinks better
Now that permalinks could be not-matrix.to we should be safer in what we'll allow.
This commit is contained in:
parent
ce0a534db1
commit
6e6f8a13e1
1 changed files with 4 additions and 2 deletions
|
@ -447,10 +447,12 @@ export function bodyToHtml(content, highlights, opts={}) {
|
||||||
const match = BIGEMOJI_REGEX.exec(contentBodyTrimmed);
|
const match = BIGEMOJI_REGEX.exec(contentBodyTrimmed);
|
||||||
emojiBody = match && match[0] && match[0].length === contentBodyTrimmed.length &&
|
emojiBody = match && match[0] && match[0].length === contentBodyTrimmed.length &&
|
||||||
// Prevent user pills expanding for users with only emoji in
|
// Prevent user pills expanding for users with only emoji in
|
||||||
// their username
|
// their username. Permalinks (links in pills) can be any URL
|
||||||
|
// now, so we just check for an HTTP-looking thing.
|
||||||
(
|
(
|
||||||
content.formatted_body == undefined ||
|
content.formatted_body == undefined ||
|
||||||
!content.formatted_body.includes("https://matrix.to/")
|
!content.formatted_body.includes("http:") ||
|
||||||
|
!content.formatted_body.includes("https:")
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue