Opened 12 years ago
Last modified 6 years ago
#21762 new defect (bug)
Storing a multidimensional array using register_setting double-serializes subarrays identified with a string
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.4 |
Component: | Database | Keywords: | |
Focuses: | Cc: |
Description
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.
Change History (4)
Note: See
TracTickets for help on using
tickets.
Related: #15057, #16597