Skip to content

Exception when loading a general.cfg that has a '!' as value #1

@romanlum

Description

@romanlum

When a gerneral.cfg is loaded and has a '!' in one of the values this exception occurs:

PHP Warning: syntax error, unexpected '!' in /opt/loxberry/config/system/general.cfg on line 54
in /opt/loxberry/data/plugins/unifi/vendor/moay/config_lite/Config/Lite.php on line 131
Warning: syntax error, unexpected '!' in /opt/loxberry/config/system/general.cfg on line 54
in /opt/loxberry/data/plugins/unifi/vendor/moay/config_lite/Config/Lite.php on line 131
PHP Fatal error: Uncaught Config_Lite_Exception_Runtime: failure, can not parse the file: /opt/loxberry/config/system/general.cfg in /opt/loxberry/data/plugins/unifi/vendor/moay/config_lite/Config/Lite.php:133

The problem is that the string values are not quoted in the loxberry general.cfg and it is likely that the miniserver password contains a '!'.

[MINISERVER1]
PASS=test12345!

One fix would be to use INI_SCANNER_RAW when constructing the Config_Lite object.
$this->config = new \Config_Lite($fileName, null, INI_SCANNER_RAW);

If this fix would be ok for you i can create a pull request.

thx

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions