[wp-trac] [WordPress Trac] #22192: update_option() strict checks can cause false negatives
WordPress Trac
noreply at wordpress.org
Tue Sep 26 13:55:03 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
--------------------------------------+--------------------------
Comment (by flixos90):
@Mamaduka @mukesh27 As far as I can tell, I can think of two potential
solutions to the problem:
* Either we temporarily remove any `pre_option_{$option}` filters before
getting the option from the database within `update_option()`, in order to
get the ''actual'' option. The value won't be otherwise used, so I think
that could be fine.
* Or we make an actual database query to see whether the value exists in
the database. That sounds like a more reliable solution to the underlying
problem, however it could introduce other unintended side effects.
I'm personally leaning towards the first so far since it would be a
simpler change.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/22192#comment:55>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list