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

WordPress Trac noreply at wordpress.org
Tue Feb 9 15:48:43 UTC 2016


#35379: update_network_option changes stored option value if sanitize_option
detects error
--------------------------------------+------------------------
 Reporter:  thomaswm                  |       Owner:
     Type:  defect (bug)              |      Status:  new
 Priority:  normal                    |   Milestone:  4.5
Component:  Options, Meta APIs        |     Version:  3.0
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:  multisite
--------------------------------------+------------------------
Changes (by codex-m):

 * keywords:  needs-patch needs-unit-tests => has-patch has-unit-tests


Comment:

 I manage a multisite and came across this issue. My attempt to solve this
 in my local multisite is passing a new parameter for sanitize_option. This
 parameter is the network ID which can be an integer when using for a
 specific network in a multisite. Or it can be TRUE to use the current
 network. By default, it's false for non-multisite implementations. See
 attached 35379.diff.

 I wrote some unit for test (see attached 35379_unit_test.diff). Covering
 three network affected options (admin_email, siteurl and WPLANG). This
 test also detects the issue (if the patch is not applied and confirms the
 fix when patch is applied.

 In addition, I ran the overall unit test before and after the patch and I
 don't see any side effects on this. Feel free to review ;) Thanks a lot!

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


More information about the wp-trac mailing list