[wp-trac] [WordPress Trac] #53986: Problematic error-handling in sanitize_option()

WordPress Trac noreply at wordpress.org
Tue Nov 30 21:00:47 UTC 2021


#53986: Problematic error-handling in sanitize_option()
--------------------------------------+-----------------------------
 Reporter:  iCaleb                    |       Owner:  SergeyBiryukov
     Type:  defect (bug)              |      Status:  closed
 Priority:  normal                    |   Milestone:  5.9
Component:  Options, Meta APIs        |     Version:  4.2.3
 Severity:  normal                    |  Resolution:  fixed
 Keywords:  has-patch has-unit-tests  |     Focuses:
--------------------------------------+-----------------------------
Changes (by SergeyBiryukov):

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


Comment:

 In [changeset:"52294" 52294]:
 {{{
 #!CommitTicketReference repository="" revision="52294"
 Options, Meta APIs: Improve error handling in `sanitize_option()`.

 To prevent potential false negatives, set `$error` to `null` initially, so
 we can better tell if it was ever changed during the sanitization and be
 able to better react if an empty string is added to it.

 Additionally, and mainly for the sake of the Settings API at this point,
 add error messages to some `WP_Error` objects returned from `wpdb` methods
 that were previously causing the issues here.

 Follow-up to [32791].

 Props iCaleb, audrasjb, hellofromTonya, SergeyBiryukov.
 Fixes #53986.
 }}}

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


More information about the wp-trac mailing list