forked from GithubBackups/vichan
Fixed config-editor.php bug
Who the hell thought that eval+@ is a good alternative to try catch block?
This commit is contained in:
parent
49276440e0
commit
d3e8eb7480
@ -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)) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user