fix: 🐛 Leave null cache.serializable_classes untouched under Laravel 13#211
Merged
Merged
Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
13.2.0(#209) auto-registers Geocoder model classes intocache.serializable_classesso cachedCollections ofAddressobjects survive Laravel 13's hardened deserialization. But the merge logic coerced any non-array value to[]— includingnull.Laravel 13's
cache.serializable_classesis tri-state:nullfalse[...]Coercing
null→ array silently switched the entire application into strict allow-list mode, so cache reads for every class outside this package started failing after a patch/minor bump. Reported in #210.Fix
Read the value first and return early when it's
null— when enforcement is off there's nothing to register, and we must not turn it on. Thefalse→ array path is preserved, so genuinely hardened Laravel 13 apps still get working geocoder caching.Test plan
it('leaves a null cache.serializable_classes untouched ...')asserts anullvalue staysnullafter registration.cache.serializable_classes => false(the real Laravel 13 default) so the discovery tests exercise the true hardened starting point rather than the implicitnullTestbench leaves in place.false-coercion and merge-preservation tests stay green.Fixes #210