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.
Description
Update how we store/retrieve serialized values (the
text_datetime_timestamp_timezone
field).Also… bumps our min. php support to 7.4 🥳
Motivation and Context
security.
Risk Level
Testing procedure
Before this PR
Create fields (preferably in every core object type) with the
text_datetime_timestamp_timezone
field typeAnd you can test the
options-page
type with the following setup: https://gist.github.com/jtsternberg/d6ab21ca3a7de1a77d1adfefa0b9445fIn each object type, udpate the value, save, see that it all works as expected.
Check the DB values -- you should see a double-serialized
DateTime
objectTry using
get_post_meta
to retrieve the value and see that it's a serializedDateTime
object. (if you used the example above, you can see the value in thebefore_field
callback).Next
get_post_meta
value still gives you a serializedDateTime
object.wp post meta update 1 _yourprefix_demo_datetime_timestamp_timezone 'O:4:"Evil":2:{s:4:"hack";N;s:2:"me";R:2;}'