avoid potential RegExp denial-of-service (#5135)

closes #5133
closes #5134
This commit is contained in:
Alex Lam S.L
2021-09-29 18:49:46 +01:00
committed by GitHub
parent f766babf5e
commit 157521066f
4 changed files with 6 additions and 6 deletions

View File

@@ -143,7 +143,7 @@ function push_uniq(array, el) {
}
function string_template(text, props) {
return text.replace(/\{([^}]+)\}/g, function(str, p) {
return text.replace(/\{([^{}]+)\}/g, function(str, p) {
var value = props[p];
return value instanceof AST_Node ? value.print_to_string() : value;
});