mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-22 23:53:48 +01:00
Merge pull request #3093 from mbrannen/expr-remainder-fix
updated regex sanitization
This commit is contained in:
commit
2dfecc8ad0
@ -17,7 +17,7 @@ export function expr(
|
|||||||
const expr = args.join("");
|
const expr = args.join("");
|
||||||
|
|
||||||
// Sanitize the math expression
|
// Sanitize the math expression
|
||||||
const sanitizedExpr = expr.replace(/s+/g, "").replace(/[^-()\d/*+.]/g, "");
|
const sanitizedExpr = expr.replace(/s+/g, "").replace(/[^-()\d/*+.%]/g, "");
|
||||||
let result;
|
let result;
|
||||||
try {
|
try {
|
||||||
result = eval(sanitizedExpr);
|
result = eval(sanitizedExpr);
|
||||||
|
Loading…
Reference in New Issue
Block a user