Description
Two consistency bugs in the options meta backend, found via integration tests of all Meta backends:
Option::get_meta() never unserializes values. Unlike MetaLocation::get_meta(), which runs values through acf_maybe_unserialize(), the option backend returns raw strings — so acf_get_meta( 'options' ) yields serialized array strings where every other location yields arrays.
Option::update_meta() calls wp_unslash() on values, while MetaLocation::update_meta() wp_slash()es before update_metadata(). Net effect: acf_copy_metadata() to an options location strips backslashes (C:\temp\new becomes C:tempnew), while post-to-post copies preserve them.
Affected code
includes/Meta/Option.php:45 (get_meta)
includes/Meta/Option.php:87 (update_meta)
Reproduction
Repro tests in #450, tests/php/includes/meta/test-meta-locations.php:
test_option_get_meta_pairs_values_with_references
test_option_update_meta_unslashes_values
Note before fixing
These code paths are ported from upstream — verify whether the same behavior exists upstream first. If it does, a divergence decision is needed (or an upstream-first fix); if it does not, this is a porting regression and can be fixed directly.
Found during the 2026-06 test campaign (see PR #450).
Description
Two consistency bugs in the options meta backend, found via integration tests of all Meta backends:
Option::get_meta()never unserializes values. UnlikeMetaLocation::get_meta(), which runs values throughacf_maybe_unserialize(), the option backend returns raw strings — soacf_get_meta( 'options' )yields serialized array strings where every other location yields arrays.Option::update_meta()callswp_unslash()on values, whileMetaLocation::update_meta()wp_slash()es beforeupdate_metadata(). Net effect:acf_copy_metadata()to an options location strips backslashes (C:\temp\newbecomesC:tempnew), while post-to-post copies preserve them.Affected code
includes/Meta/Option.php:45(get_meta)includes/Meta/Option.php:87(update_meta)Reproduction
Repro tests in #450,
tests/php/includes/meta/test-meta-locations.php:test_option_get_meta_pairs_values_with_referencestest_option_update_meta_unslashes_valuesNote before fixing
These code paths are ported from upstream — verify whether the same behavior exists upstream first. If it does, a divergence decision is needed (or an upstream-first fix); if it does not, this is a porting regression and can be fixed directly.
Found during the 2026-06 test campaign (see PR #450).