-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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: replace null character when serializing #49528
fix: replace null character when serializing #49528
Conversation
c8ec037
to
7e22304
Compare
/backport to stable30 |
/backport to stable29 |
/backport to stable28 |
While this seems a much simple way of fixing the issue that what I've tried at #39084, what happens when you unserialize the values? Are the objects valid and make sense, since you loose the fact that a property is set to You also need to add a repair step to remove all broken values (see |
Yes, they properly unserialize to a php object. If you replace the null character with a space. Tested this.
yes, a repair step will be needed. I just need to investigate, if we can just do one for Postgres only, MySQL seems to handle null character properly. |
But the property that was previously |
So this is the value that was causing the issue, The part to the sting that is the issue is the " * value" the space before and after the * are a null characters, basically this "null*null". The word value is actually a property inside the object. I don't know all the in and outs of serialize but to me it looks like "null*null" is a marker for a private property. On that note, you might be right if there is a value that is null and serialize converts it to a null character then there might be a issue. But then we are back to square 1, and there is no real way to fix this for postgres. The only other way I can think of, would be to replace the null with the word null and then replace it again on unserialize. |
The only way I've thought of is to have the column type accept null terminators, by setting it to I think your solution might be an easier workaround that we can try until some other serious issue gets reported. It just needs the cleanup step. |
I agree, done and done, made the repair step actually check if the property is broken, instead of just blindly removing them all. |
Done. Made it handle all object properties and run as a expensive repair step. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks sane!
Could you add a test for the unserialization of a legacy object?
Done. Did one for the current double encoding and for the legacy single encoding. |
Signed-off-by: SebastianKrupinski <[email protected]>
116b7e5
to
c1dd8dd
Compare
Summary
Serialize() creates string with null character, this causes issues when saving data in certain databases
Checklist