Ignore img tags in HTML if src is not specified

This applies to HTML messages and group summaries.
pull/21833/head
Luke Barnard 2017-11-06 17:52:46 +00:00
parent f1db564506
commit d14f943629
1 changed files with 1 additions and 1 deletions

View File

@ -208,7 +208,7 @@ const sanitizeHtmlParams = {
// Strip out imgs that aren't `mxc` here instead of using allowedSchemesByTag
// because transformTags is used _before_ we filter by allowedSchemesByTag and
// we don't want to allow images with `https?` `src`s.
if (!attribs.src.startsWith('mxc://')) {
if (!attribs.src || !attribs.src.startsWith('mxc://')) {
return { tagName, attribs: {}};
}
attribs.src = MatrixClientPeg.get().mxcUrlToHttp(