[Security] Fix ReDoS

Fix ReDoS
This commit is contained in:
ready-research 2021-09-28 19:27:46 +05:30 committed by GitHub
parent f766babf5e
commit e99c7aa15b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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