Invalid serialized data stored by maybe_serialize() function
-
In the process of developing my plugin I discovered that in some rare circumstances data that is set using the update_option() function will result in invalid serialized data being stored in the database. It was causing the data in my Google Review plugin to be result and losing all previously collected data.
It is likely to be the maybe_serialize() function – one or more of the characters may be causing an incorrect string length count, or something similar to this.
I have test data available to can replicate this error. This is an excerpt:
a:101:{s:45:"1570449412_4_bcb7bc02734e48f0a14afe817e028808";a:16:{s:2:"id";i:1;s:8:"place_id";s:27:"ChIJ37ukkHcFdkgRq7UEJ1_6j5I";s:5:"order";i:1;s:7:"checked";i:1582008103;s:9:"retrieved";i:1582007925;s:8:"imported";b:0;s:13:"time_estimate";b:0;s:6:"status";b:1;s:11:"author_name";s:5:"Naz A";s:10:"author_url";s:65:"https://www.google.com/maps/contrib/117241935186177377572/reviews";s:8:"language";s:2:"en";s:17:"profile_photo_url";s:110:"https://lh4.ggpht.com/-1oyiszUUupc/AAAAAAAAAAI/AAAAAAAAAAA/6lWQROyZ-gs/s128-c0x00000000-cc-rp-mo-ba4/photo.jpg";s:6:"rating";i:4;s:25:"relative_time_description";s:12:"4 months ago";s:4:"text";s:331:"They have a lovely wrap selection from 12 - 5. I've always ... s:10:"author_url";s:57:"https://www.google.com/maps/contrib/102840331523623566629";s:8:"language";N;s:17:"profile_photo_url";s:110:"https://lh6.googleusercontent.com/-8TFGw3UWN30/AAAAAAAAAAI/AAAAAAAAAAA/qpEGZELDfFw/s40-c-rp-mo-br100/photo.jpg";s:6:"rating";d:4;s:25:"relative_time_description";s:11:"2 weeks ago";s:4:"text";N;s:4:"time";i:1580774400;s:7:"checked";N;s:9:"retrieved";N;s:8:"imported";i:1582008103;s:13:"time_estimate";b:1;s:6:"status";b:1;}}All the best,
Noah
The page I need help with: [log in to see the link]
The topic ‘Invalid serialized data stored by maybe_serialize() function’ is closed to new replies.