Home>Support>unserialize fails after moving db or saving db

unserialize fails after moving db or saving db

I’ve found that the page builder plugin stops working if I manually save the ‘panels_data’ meta_value in the wp_postmeta table inside phpMyAdmin. i dont have to make any changes, i just have to resave for this issue to occurr.

I thought it might be an encoding issue, but both the database and wordpress are utf8, so im not exactly sure why this issue is happening.

I have a temporary solution by overriding the wordpress core function maybe_unserialize with this:

function siteorigin_maybe_unserialize( $original ) {
if ( is_serialized( $original ) ) { // don’t attempt to unserialize data that wasn’t serialized going in
// fix from: http://www.php.net/manual/en/function.unserialize.php#76012
$original = preg_replace(‘!s:(d+):”(.*?)”;!se’, “‘s:’.strlen(‘$2′).’:”$2″;'”, $original );
return @unserialize( $original );
}
return $original;
}

This is the only plugin where i have noticed this issue, so I’m hoping this could be fixed in future releases, so that I don’t have to make direct code modifications to the plugin which have to potential to be overwritten next time I go to update.

This is our free support forum. Replies can take several days. If you need fast email support, please purchase a SiteOrigin Premium license.

Get The Most Out of SiteOrigin with SiteOrigin Premium

Find Out More