[wp-trac] [WordPress Trac] #21989: update_option() calls sanitize_option() twice when option does not exist

WordPress Trac noreply at wordpress.org
Fri Nov 25 15:30:19 UTC 2022


#21989: update_option() calls sanitize_option() twice when option does not exist
-------------------------------------------------+-------------------------
 Reporter:  MikeSchinkel                         |       Owner:  (none)
     Type:  defect (bug)                         |      Status:  new
 Priority:  normal                               |   Milestone:  Future
                                                 |  Release
Component:  Options, Meta APIs                   |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  dev-feedback has-patch needs-        |     Focuses:
  testing                                        |  performance
-------------------------------------------------+-------------------------

Comment (by gregstorkan):

 I'm sure I must be missing something but would it not work to just
 sanitize after the `add_option()` call inside `update_option()`? I don't
 know how to use SVN so I posted a [https://github.com/WordPress/wordpress-
 develop/pull/3676 pull request on GitHub] but since `add_option()` would
 re-sanitize the value after it gets filtered anyway, why would it break
 the filters to sanitize after them in `update_option()` as well?

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/21989#comment:31>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list