mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
Rendered invalid URLs as plain text when parsing markdown (#3616)
This commit is contained in:
committed by
Christopher Speller
parent
5937473c5f
commit
40c47dcf0b
@@ -139,10 +139,10 @@ class MattermostMarkdownRenderer extends marked.Renderer {
|
||||
const unescaped = decodeURIComponent(unescape(href)).replace(/[^\w:]/g, '').toLowerCase();
|
||||
|
||||
if (unescaped.indexOf('javascript:') === 0 || unescaped.indexOf('vbscript:') === 0 || unescaped.indexOf('data:') === 0) { // eslint-disable-line no-script-url
|
||||
return '';
|
||||
return text;
|
||||
}
|
||||
} catch (e) {
|
||||
return '';
|
||||
return text;
|
||||
}
|
||||
|
||||
if (!(/[a-z+.-]+:/i).test(outHref)) {
|
||||
|
||||
Reference in New Issue
Block a user