[wp-trac] [WordPress Trac] #51352: Unexpected behavior when switching autoload between update_option

WordPress Trac noreply at wordpress.org
Fri Oct 6 16:31:37 UTC 2023


#51352: Unexpected behavior when switching autoload between update_option
--------------------------------------+-----------------------
 Reporter:  pentatonicfunk            |       Owner:  flixos90
     Type:  defect (bug)              |      Status:  closed
 Priority:  normal                    |   Milestone:  6.4
Component:  Options, Meta APIs        |     Version:
 Severity:  normal                    |  Resolution:  fixed
 Keywords:  has-patch has-unit-tests  |     Focuses:
--------------------------------------+-----------------------
Changes (by flixos90):

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


Comment:

 In [changeset:"56796" 56796]:
 {{{
 #!CommitTicketReference repository="" revision="56796"
 Options, Meta APIs: Fix bug with `update_option()` updating the wrong
 cache, leading to potentially stale values being returned.

 When using the `$autoload` parameter of `update_option()` alongside an
 option value update, prior to this changeset the function would update the
 incorrect cache, not respecting the new autoload value. This could have
 severe implications such as returning a stale option value when the option
 in fact had already been deleted.

 This changeset fixes the bug alongside test coverage that failed with
 `trunk` but now passes.

 Props kkmuffme, pentatonicfunk, SergeyBiryukov, oglekler, azaozz,
 spacedmonkey, nicolefurlan, joemcgill, flixos90.
 Fixes #51352.
 }}}

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


More information about the wp-trac mailing list