[wp-trac] [WordPress Trac] #33582: update_option call sanitize_option twice for new options

WordPress Trac noreply at wordpress.org
Fri Aug 28 07:39:46 UTC 2015


#33582: update_option call sanitize_option twice for new options
--------------------------------+-----------------------------
 Reporter:  Mbertu              |      Owner:
     Type:  defect (bug)        |     Status:  new
 Priority:  normal              |  Milestone:  Awaiting Review
Component:  Options, Meta APIs  |    Version:  trunk
 Severity:  normal              |   Keywords:
  Focuses:                      |
--------------------------------+-----------------------------
 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?

--
Ticket URL: <https://core.trac.wordpress.org/ticket/33582>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list