[wp-trac] [WordPress Trac] #21762: Storing a multidimensional array using register_setting double-serializes subarrays identified with a string
WordPress Trac
wp-trac at lists.automattic.com
Fri Aug 31 22:43:16 UTC 2012
#21762: Storing a multidimensional array using register_setting double-serializes
subarrays identified with a string
--------------------------+-----------------------------
Reporter: sekatsim | Owner: sekatsim
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Database | Version: 3.4.1
Severity: normal | Keywords:
--------------------------+-----------------------------
Storing a multidimensional array, such as `$options['my-option'][$id] =
"value"`, into the database using register_setting results in the "my-
option" string getting double serialized. The option_value is stored as:
`s:9:"'my-option'";a:1:{s:9:"option-id";s:5:"value";}`
The my-option array is encased in both single and double quotes, so that
`isset($options['option-id']` evaluates false, but `isset($options
["'option-id'"]` evaluates true.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/21762>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list