Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parse .ini files and catch errors #5251

Open
tbauriedel opened this issue Aug 27, 2024 · 4 comments
Open

Parse .ini files and catch errors #5251

tbauriedel opened this issue Aug 27, 2024 · 4 comments
Labels
good first issue Good for newcomers help wanted Contributions are welcome low priority Something for later...

Comments

@tbauriedel
Copy link
Member

tbauriedel commented Aug 27, 2024

Describe the bug

If you write wrong comments in the ini files (with an # instead of ;) this leads to a fatal error in the browser.

Using # instead of ; is not the correct way, I know.
But the Framework should be smart enough to catch these misconfiguration and give you an clean error.

To Reproduce

Create a new section in a .ini file and add comments for that with #

#[foo]
#bar = 123

Expected behavior

The framework should catch this and give a clean error.

Screenshots

error
(The censored part are only bookmarks of the browser and not part of the error message)

Your Environment

Include as many relevant details about the environment you experienced the problem in

  • Icinga Web 2 version and modules (System - About): 2.12.1
  • PHP version used (php --version): 8.2.20
  • icinga/icinga-php-library: 0.14.1
  • icinga/icinga-php-thirdparty: 0.12.1
@tbauriedel
Copy link
Member Author

ref/NC/827716

@nilmerg
Copy link
Member

nilmerg commented Aug 27, 2024

Hm, if someone fiddles with INI files themselves, it's their responsibility to make sure everything is correct. The error message seems to contain enough information to ensure this. The only missing thing seems to be the path to the INI file. This should be added.

@nilmerg nilmerg added low priority Something for later... help wanted Contributions are welcome good first issue Good for newcomers labels Aug 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Contributions are welcome low priority Something for later...
Projects
None yet
Development

No branches or pull requests

5 participants
@nilmerg @tbauriedel and others