Opened 9 years ago
Closed 7 years ago
#33582 closed defect (bug) (duplicate)
update_option call sanitize_option twice for new options
Reported by: | Mbertu | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Options, Meta APIs | Keywords: | |
Focuses: | Cc: |
Description
I've found this, for me is a bug in the add/update option procedure.
If the option doesn't already exist in the db, is called anyway the update_option function in /wp-includes/option.php.
This funciton, at the line 256 execute the function sanitize_option this function goes to execute the callback pased to the register_setting function. But if the option doesn't already exist in the db, is executed further the function add_option that again call the sanitize_option, and again execute the register_setting callback but this time with the result of the first callback execution as input.
The problem, for me, is that the first execution manipulate the submited post data and generate a different output, so the second execution of the callback fails.
There is a problem with the input image too, but I don't now exactly why (only on the first submit for the option).
Is that a bug, or I've miss something?
I think this is a duplicate of #21989.