mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
BUGFIX: markdown sanitize on null/undefined text
This commit is contained in:
parent
06a87fb0ee
commit
c97de2c449
@ -160,7 +160,7 @@ Discourse.Markdown = {
|
|||||||
@return {String} text The sanitized text
|
@return {String} text The sanitized text
|
||||||
**/
|
**/
|
||||||
sanitize: function(text) {
|
sanitize: function(text) {
|
||||||
if (!window.html_sanitize) return "";
|
if (!window.html_sanitize || !text) return "";
|
||||||
text = text.replace(/<([^A-Za-z\/]|$)/g, "<$1");
|
text = text.replace(/<([^A-Za-z\/]|$)/g, "<$1");
|
||||||
return window.html_sanitize(text, Discourse.Markdown.urlAllowed, Discourse.Markdown.nameIdClassAllowed);
|
return window.html_sanitize(text, Discourse.Markdown.urlAllowed, Discourse.Markdown.nameIdClassAllowed);
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user