mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-16 14:28:36 +02:00
updated regex sanitization
-allows % -updated escape characters to \
This commit is contained in:
@@ -17,7 +17,7 @@ export function expr(
|
||||
const expr = args.join("");
|
||||
|
||||
// Sanitize the math expression
|
||||
const sanitizedExpr = expr.replace(/s+/g, "").replace(/[^-()\d/*+.]/g, "");
|
||||
const sanitizedExpr = expr.replace(/s+/g, "").replace(/[^-()\d\*+.\%]/g, "");
|
||||
let result;
|
||||
try {
|
||||
result = eval(sanitizedExpr);
|
||||
|
||||
Reference in New Issue
Block a user