[wp-trac] [WordPress Trac] #21989: update_option() calls sanitize_option() twice when option does not exist
WordPress Trac
noreply at wordpress.org
Wed Feb 21 21:58:56 UTC 2024
#21989: update_option() calls sanitize_option() twice when option does not exist
-------------------------------------------------+-------------------------
Reporter: MikeSchinkel | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Future
| Release
Component: Options, Meta APIs | Version:
Severity: normal | Resolution:
Keywords: dev-feedback has-patch needs- | Focuses:
testing | performance
-------------------------------------------------+-------------------------
Comment (by inf3rno):
I wonder how this wasn't fixed in the past 11 years. I reported something
similar, maybe a duplicate.
https://core.trac.wordpress.org/ticket/60595#ticket I spent an hour on it.
You are playing with developers time...
I think the main problem here that we have only a single callback for type
conversion, sanitization, API call, encryption, etc... Sanitization should
be idempotent in theory, but we have a lot of other features which are not
idempotent. Either we need a guarantee to call sanitize_callback only once
or we need other callbacks which are called only once.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/21989#comment:37>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list