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

Fix: cache - base64 value if it contains \0 and the connection is sqlite3 #54084

Closed
wants to merge 2 commits into from

Conversation

adamkiss
Copy link

@adamkiss adamkiss commented Jan 4, 2025

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

Fixes #54082

@adamkiss adamkiss changed the title Fix: base74 value if it contains \0 and the connection is sqlite3 Fix: cache - base64 value if it contains \0 and the connection is sqlite3 Jan 4, 2025
@taylorotwell
Copy link
Member

Would this not break all existing SQLite cache values when it tries to base64 decode?

@adamkiss
Copy link
Author

adamkiss commented Jan 6, 2025

@taylorotwell It wouldn't, because base64 encoded serialisation doesn't include : and ;, which is detected when the read happens: it first checks if the value contains them (= it's raw serialisation) and when it doesn't find any, it decodes the value with base64 first before deserialising.

It does the same thing when using PostgresConnection

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