Skip to content

Encode cache values for SQLite with base64 to prevent failing on \0 characters#54178

Merged
taylorotwell merged 1 commit into
laravel:11.xfrom
adamkiss:fix-cache-sqlite-null-strings
Jan 13, 2025
Merged

Encode cache values for SQLite with base64 to prevent failing on \0 characters#54178
taylorotwell merged 1 commit into
laravel:11.xfrom
adamkiss:fix-cache-sqlite-null-strings

Conversation

@adamkiss

Copy link
Copy Markdown
Contributor

Fixes a Cache serialization issue when the cache store is sqlite3 and the cached/serialized object contains any private or protected methods/properties.

It also handles reading non-encoded (previous) cache from SQLite - if it doesn't detect : or ;, it doesn't to try to base64_decode and just serializes the value.

Fixes #54082

@taylorotwell taylorotwell merged commit 85a02ca into laravel:11.x Jan 13, 2025
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.

Cache on Sqlite3 includes NULL character in the value

2 participants