From c97de2c449d0ccfced56d66bb668e559cbd68a58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Hanol?= Date: Wed, 14 May 2014 12:14:33 +0200 Subject: [PATCH] BUGFIX: markdown sanitize on null/undefined text --- app/assets/javascripts/discourse/lib/markdown.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/javascripts/discourse/lib/markdown.js b/app/assets/javascripts/discourse/lib/markdown.js index 7d408619517..e3a629314ca 100644 --- a/app/assets/javascripts/discourse/lib/markdown.js +++ b/app/assets/javascripts/discourse/lib/markdown.js @@ -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); },