• Resolved James Lee

    (@jameslhc)


    I’m seeing errors like the ones below in my error_log file:
    PHP Warning: unserialize() expects parameter 1 to be string, array given in wp-content/plugins/geodirectory/includes/custom-fields/output-functions.php on line 2290

    This line specifically:
    $extra_fields = stripslashes_deep(unserialize($cf['extra_fields']));

    I am using a persistent Object Cache (the Docket Cache plugin) which unserialized the values stored in cache so your plugin is unserializing it the second time.

    Maybe changing unserialize() to maybe_unserialize() will solve the problem?

    Here’s a reference of the same problem happening to another plugin:
    https://www.ads-software.com/support/topic/php-warning-unserialize-expects-parameter-1-to-be-string-array-given/

Viewing 1 replies (of 1 total)
  • Hi James,

    We have changed unserialize() to maybe_unserialize() to prevent PHP warning. It will be updated in next release. Meantime try to re-save address field from CPT > Settings > Custom Fields.

    Thanks,
    Kiran

Viewing 1 replies (of 1 total)
  • The topic ‘PHP Warning: unserialize() expects parameter 1 to be string, array given’ is closed to new replies.