[wp-trac] [WordPress Trac] #22192: update_option() strict checks can cause false negatives

WordPress Trac noreply at wordpress.org
Tue Oct 10 09:49:05 UTC 2023


#22192: update_option() strict checks can cause false negatives
--------------------------------------+--------------------------
 Reporter:  nacin                     |       Owner:  mukesh27
     Type:  defect (bug)              |      Status:  reopened
 Priority:  normal                    |   Milestone:  6.4
Component:  Options, Meta APIs        |     Version:
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:  performance
--------------------------------------+--------------------------
Changes (by costdev):

 * status:  closed => reopened
 * resolution:  fixed =>


Comment:

 Hey @mukesh27 @flixos90 @joemcgill I was taking an early look at some
 possible alternative approaches for the pre-filters "toggle" in
 `update_option()`/`update_network_option()` and on my travels, a thought
 occurred about our current approach.

 We're currently "toggling" `pre_option_{$option}` filters so we can get
 the raw value. What if someone filters the newer global `pre_option`
 instead? This is straightforward to add a "toggle" for, and we can use a
 data provider of pre-filter hook names for the existing tests
 [https://github.com/WordPress/wordpress-develop/pull/5448 PR 5448]
 implements this.

 With the changes to `update_network_option()` now committed ([56814] /
 #59360), we'll need to follow up to do the same in
 `update_network_option()`, with any additional considerations that may be
 necessary. I'm AFK for a lot of today, so I won't get a chance to prep a
 PR for `update_network_option()` this before 6.4 Beta 3, but can follow up
 this evening.

 For now, can you take a look at [https://github.com/WordPress/wordpress-
 develop/pull/5448 PR 5448] and see if we can get it into 6.4 Beta 3?
 Thanks!

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


More information about the wp-trac mailing list