Ignore arrays in config.lua (fixes experienceStages loading)

Also change version to 0.7.13-dev
This commit is contained in:
slawkens 2021-12-16 20:24:34 +01:00
parent af1ec6722b
commit 1578d186c2
3 changed files with 16 additions and 2 deletions

View File

@ -1,5 +1,10 @@
# Changelog
## [0.7.13 - not-release-yet]
### Fixed
* Ignore arrays in config.lua (fixes experienceStages loading)
## [0.7.12 - 18.02.2020]
### Fixed
* change guild nick function causing crash on TFS 1.x because of invalid characters being accepted

View File

@ -26,7 +26,7 @@
session_start();
define('MYAAC', true);
define('MYAAC_VERSION', '0.7.12');
define('MYAAC_VERSION', '0.7.13-dev');
define('DATABASE_VERSION', 22);
define('TABLE_PREFIX', 'myaac_');
define('START_TIME', microtime(true));

View File

@ -895,6 +895,13 @@ 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)
{
@ -921,9 +928,11 @@ 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(substr($value, 0 , 1) == '{' && substr($value, -1 , 1) == '}') {
//elseif(substr($value, 0 , 1) == '{' && substr($value, -1 , 1) == '}') {
elseif(@$value[0] === '{') {
// arrays are not supported yet
// just ignore the error
continue;
}
else
{