Skip to content

Commit

Permalink
Fix crash in Text.escapeHTML
Browse files Browse the repository at this point in the history
  • Loading branch information
AgustinSRG committed Aug 30, 2016
1 parent 1219c37 commit 2af0367
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/tools/text.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ exports.trim = function (str) {
*/
exports.escapeHTML = function (str) {
if (!str) return '';
return ('' + str).escapeHTML();
return ('' + str).replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;').replace(/'/g, '&apos;').replace(/\//g, '&#x2f;');
};

/**
Expand Down

0 comments on commit 2af0367

Please sign in to comment.