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

WordPress Trac noreply at wordpress.org
Thu Aug 26 22:13:29 UTC 2021


#53986: Problematic error-handling in sanitize_option()
----------------------------------------+---------------------
 Reporter:  iCaleb                      |       Owner:  (none)
     Type:  defect (bug)                |      Status:  new
 Priority:  normal                      |   Milestone:  5.9
Component:  Options, Meta APIs          |     Version:  trunk
 Severity:  normal                      |  Resolution:
 Keywords:  has-patch needs-unit-tests  |     Focuses:
----------------------------------------+---------------------

Comment (by iCaleb):

 Updated the PR w/ a test. Could do a more specific test that covers a more
 realistic result, but would need to mock
 `$wpdb->strip_invalid_text_for_column()` as it can be the one responsible
 for returning the WP_Error that was previously breaking things:
 https://github.com/WordPress/wordpress-
 develop/blob/e83a341cc082864edf69257fded43d70d8a27685/src/wp-
 includes/formatting.php#L4873

 The test I added does technically cover the needed code path though, so
 think we'll all good.

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


More information about the wp-trac mailing list