Opened 14 years ago
Last modified 7 years ago
#21762 new defect (bug)
Storing a multidimensional array using register_setting double-serializes subarrays identified with a string
| Reported by: | sekatsim | Owned by: | sekatsim |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Database | Version: | 3.4 |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: |
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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Related: #15057, #16597