Merge pull request #974 from Mystia-Izakaya/patch-1

Fixed config-editor.php bug
This commit is contained in:
Lorenzo Yario 2025-09-12 12:37:23 -07:00 committed by GitHub
commit 2c57e84ac5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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)) {