From f486cd684c94c12db48b45d52b1472a1b9661029 Mon Sep 17 00:00:00 2001 From: Esa-Matti Suuronen Date: Thu, 4 Oct 2018 00:34:42 +0300 Subject: [PATCH] Try to fix regexp redos fixes #510 --- unescapeHTML.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unescapeHTML.js b/unescapeHTML.js index 78b59c28..df1d18ef 100644 --- a/unescapeHTML.js +++ b/unescapeHTML.js @@ -2,7 +2,7 @@ var makeString = require('./helper/makeString'); var htmlEntities = require('./helper/htmlEntities'); module.exports = function unescapeHTML(str) { - return makeString(str).replace(/\&([^;]+);/g, function(entity, entityCode) { + return makeString(str).replace(/\&([^;]{1,10});/g, function(entity, entityCode) { var match; if (entityCode in htmlEntities) {