return empty string instead of blowing up when fixing HTML

pull/1/head
ansuz 2017-03-02 11:38:20 +01:00
parent e3f26263f4
commit a9afa24428
1 changed files with 1 additions and 0 deletions

View File

@ -164,6 +164,7 @@ define([
var isArray = common.isArray = $.isArray;
var fixHTML = common.fixHTML = function (str) {
if (!str) { return ''; }
return str.replace(/[<>&"']/g, function (x) {
return ({ "<": "&lt;", ">": "&gt", "&": "&amp;", '"': "&#34;", "'": "&#39;" })[x];
});