From a6108be400e622e5aa311476bbe67b07509a024a Mon Sep 17 00:00:00 2001 From: Sarjuuk Date: Sat, 4 Oct 2025 00:50:27 +0200 Subject: [PATCH] Spells/Parsing * bandaid fix parsing deeply nested formulas in non-interactive mode (should rethink how/when formulas get flagged as un-evalable) --- includes/dbtypes/spell.class.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/includes/dbtypes/spell.class.php b/includes/dbtypes/spell.class.php index 344fa8d2..f41e8161 100644 --- a/includes/dbtypes/spell.class.php +++ b/includes/dbtypes/spell.class.php @@ -910,7 +910,11 @@ class SpellList extends DBTypeList $formula = preg_replace('/(\+|-|\*|\/)(\+|-|\*|\/)/i', '\1 \2', $formula); // there should not be any letters without a leading $ - return eval('return '.$formula.';'); + try { $formula = eval('return '.$formula.';'); } + // but there can be if we are non-interactive + catch (\Throwable $e) { } + + return $formula; } // description-, buff-parsing component