* fixed config loaded when some inline comments are present

This commit is contained in:
slawkens1 2017-10-11 23:19:11 +02:00
parent 22cf7f5d4f
commit 315e0400ff

View File

@ -1173,6 +1173,10 @@ function load_config_lua($filename)
if(substr($key, 0, 2) != '--') if(substr($key, 0, 2) != '--')
{ {
$value = trim($tmp_exp[1]); $value = trim($tmp_exp[1]);
if(strpos($value, '--') !== false) {// found some deep comment
$value = preg_replace('/--.*$/i', '', $value);
}
if(is_numeric($value)) if(is_numeric($value))
$result[$key] = (float) $value; $result[$key] = (float) $value;
elseif(in_array(substr($value, 0 , 1), array("'", '"')) && in_array(substr($value, -1 , 1), array("'", '"'))) elseif(in_array(substr($value, 0 , 1), array("'", '"')) && in_array(substr($value, -1 , 1), array("'", '"')))