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

Add safelist for object unserialization #47

Merged
merged 3 commits into from
Nov 14, 2023
Merged

Conversation

rawilk
Copy link
Owner

@rawilk rawilk commented Nov 14, 2023

An issue (#46) was raised that describes an issue with not being able to store any kind of object in settings, since they will be unserialized to an object like __PHP_Incomplete_Class(...). While the default ValueSerializer can be overridden so that any objects can be unserialized properly, it may not always be desirable to create a custom class implementation of your own.

This PR adds a unserialize_safelist configuration option to allow you to specify which classes should be allowed to be unserialized. By default, we'll allow carbon date objects to be unserialized, but you are free to add more to the config.

@rawilk rawilk merged commit 7edd698 into main Nov 14, 2023
9 checks passed
@rawilk rawilk deleted the unserialize-whitelist branch November 14, 2023 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant