mirror of
https://github.com/codeninjasllc/discourse.git
synced 2025-02-17 04:01:29 -05:00
BUGFIX: markdown sanitize on null/undefined text
This commit is contained in:
parent
06a87fb0ee
commit
c97de2c449
1 changed files with 1 additions and 1 deletions
|
@ -160,7 +160,7 @@ Discourse.Markdown = {
|
|||
@return {String} text The sanitized text
|
||||
**/
|
||||
sanitize: function(text) {
|
||||
if (!window.html_sanitize) return "";
|
||||
if (!window.html_sanitize || !text) return "";
|
||||
text = text.replace(/<([^A-Za-z\/]|$)/g, "<$1");
|
||||
return window.html_sanitize(text, Discourse.Markdown.urlAllowed, Discourse.Markdown.nameIdClassAllowed);
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue