hassankhan / config

Config is a lightweight configuration file loader that supports PHP, INI, XML, JSON, and YAML files
MIT License
971 stars 136 forks source link

Fixes #115 #118

Closed filips123 closed 5 years ago

filips123 commented 5 years ago

It fixes #115.

The problem in #115 is that variable $config is already initialized in the parameter of parseString() as a string. The configuration file will then try to re-initialize it and fail it because eval() executions can see and modify variables from the real file.

This PR adds a separate "isolated" method which only executes string with eval(). It must use some weird parameter name because we must ensure that is wont be in the config file. I think that $EGsfKPdue7ahnMTy (some random string) would be enough.

hassankhan commented 5 years ago

Thanks for your PR, @filips123!

hassankhan commented 5 years ago

@filips123 I've also added you as a collaborator on the repository, so you won't have to rely on myself or @DavidePastore. We don't get enough time to give this library the love that it deserves, and I feel you've been really helpful in keeping this project alive. Thanks again for all your hard work 👍

filips123 commented 5 years ago

@hassankhan Thank you!