Skip to content

Commit

Permalink
Ignore arrays in config.lua (fixes experienceStages loading)
Browse files Browse the repository at this point in the history
In future we want to parse arrays too, this is just a temporary solution
Thread: https://otland.net/threads/myacc-problem.274795/
  • Loading branch information
slawkens committed Feb 13, 2021
1 parent ea2dc69 commit b389874
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion system/functions.php
Expand Up @@ -931,6 +931,12 @@ function load_config_lua($filename)
if(count($lines) > 0) {
foreach($lines as $ln => $line)
{
$line = trim($line);
if(@$line[0] === '{' || @$line[0] === '}') {
// arrays are not supported yet
// just ignore the error
continue;
}
$tmp_exp = explode('=', $line, 2);
if(strpos($line, 'dofile') !== false)
{
Expand All @@ -957,9 +963,10 @@ function load_config_lua($filename)
$result[$key] = (string) substr(substr($value, 1), 0, -1);
elseif(in_array($value, array('true', 'false')))
$result[$key] = ($value === 'true') ? true : false;
elseif(@$value[0] === '{' && @$value[strlen($value) - 1] === '}') {
elseif(@$value[0] === '{') {
// arrays are not supported yet
// just ignore the error
continue;
}
else
{
Expand Down

0 comments on commit b389874

Please sign in to comment.