From d3e8eb74806a24937d5ea29e9547903952a4f011 Mon Sep 17 00:00:00 2001 From: Mystia-Izakaya Date: Sun, 7 Sep 2025 01:19:14 +0300 Subject: [PATCH] Fixed config-editor.php bug Who the hell thought that eval+@ is a good alternative to try catch block? --- inc/mod/config-editor.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/inc/mod/config-editor.php b/inc/mod/config-editor.php index 688b0910..9c8dfb30 100644 --- a/inc/mod/config-editor.php +++ b/inc/mod/config-editor.php @@ -103,7 +103,13 @@ function config_vars() { continue; // This is just an alias. if (!preg_match('/^array|\[\]|function/', $var['default']) && !preg_match('/^Example: /', trim(implode(' ', $var['comment'])))) { $syntax_error = true; - $temp = eval('$syntax_error = false;return @' . $var['default'] . ';'); + try { + $temp = $var['default']; + $syntax_error = false; + } + catch (Exception $e) { + $temp = false; + } if ($syntax_error && $temp === false) { error('Error parsing config.php (line ' . $line_no . ')!', null, $var); } elseif (!isset($temp)) {