illuminatech / config

Manage Laravel configuration by persistent storage
Other
150 stars 14 forks source link

Protect against arrays that can get passed as keys #2

Closed drbyte closed 5 years ago

drbyte commented 5 years ago

Sometimes a key to be parsed might actually be an array. For testing in isPersistentKey, we need to protect against Array to String conversion errors.

The simplest way for that is to use array_key_first(), which exists in PHP 7.3

drbyte commented 5 years ago

If you're not comfortable with forcing PHP7.3+ as a dependency, then can we at least make isPersistentKey() and getItemKeys() be protected methods instead of private, so they can be extended in userland?

klimov-paul commented 5 years ago

Resolved by commit a1db1a36321f36dc8c6cdb9ad802b7937248acd9 . Thank you for the reporting.