From 1578d186c2c0dd172a1edd167d859c8829fac6d5 Mon Sep 17 00:00:00 2001 From: slawkens Date: Thu, 16 Dec 2021 20:24:34 +0100 Subject: [PATCH] Ignore arrays in config.lua (fixes experienceStages loading) Also change version to 0.7.13-dev --- CHANGELOG.md | 5 +++++ common.php | 2 +- system/functions.php | 11 ++++++++++- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c6b1756f..21128d8b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/common.php b/common.php index dda9a1b4..6d0ff488 100644 --- a/common.php +++ b/common.php @@ -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)); diff --git a/system/functions.php b/system/functions.php index 110b7c7e..9e68f259 100644 --- a/system/functions.php +++ b/system/functions.php @@ -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 {