BUGFIX: markdown sanitize on null/undefined text

This commit is contained in:
Régis Hanol 2014-05-14 12:14:33 +02:00
parent 06a87fb0ee
commit c97de2c449
1 changed files with 1 additions and 1 deletions

View File

@ -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, "&lt;$1");
return window.html_sanitize(text, Discourse.Markdown.urlAllowed, Discourse.Markdown.nameIdClassAllowed);
},