[wp-trac] [WordPress Trac] #35379: update_network_option changes stored option value if sanitize_option detects error

WordPress Trac noreply at wordpress.org
Mon Jun 6 17:26:45 UTC 2016


#35379: update_network_option changes stored option value if sanitize_option
detects error
-------------------------------------------------+-------------------------
 Reporter:  thomaswm                             |       Owner:  jeremyfelt
     Type:  defect (bug)                         |      Status:  assigned
 Priority:  normal                               |   Milestone:  4.6
Component:  Options, Meta APIs                   |     Version:  3.0
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch has-unit-tests needs-      |     Focuses:  multisite
  testing                                        |
-------------------------------------------------+-------------------------

Comment (by flixos90):

 Replying to [comment:23 codex-m]:
 > @jeremyfelt Here is my patch illustrating the use
 `sanitize_network_option`. It's now possible to sanitize network-specific
 options by putting them on their own function.

 I'm personally still in favor of the approach with one function that
 handles it. If we need `sanitize_network_option()`, we could make it a
 wrapper for that function. But it's great to get an example of what the
 alternate approach would look like, so now we have a better base to
 discuss.

 I think that, even if we go with the approach of using separate functions,
 we should start with the initial idea. Your new patch introduces
 completely new behavior which would definitely take some additional time
 to review.

 My proposal would be to follow the approach of having one flexible
 function for sanitization and aim for a 4.6 merge with that - and then
 possibly, in a follow-up ticket, continue to think about ways to split up
 these function into separate. I don't see any backwards-compatibility
 issues in coming up with outsourcing parts of the one function-approach /
 wrapping it in a `sanitize_network_option()` at a later point.

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


More information about the wp-trac mailing list