[wp-trac] [WordPress Trac] #31047: Option nonexistence should not be checked against false

WordPress Trac noreply at wordpress.org
Mon Jan 19 14:28:17 UTC 2015


#31047: Option nonexistence should not be checked against false
-------------------------------------+------------------------------
 Reporter:  GregLone                 |       Owner:
     Type:  defect (bug)             |      Status:  new
 Priority:  normal                   |   Milestone:  Awaiting Review
Component:  Options, Meta APIs       |     Version:  3.4
 Severity:  normal                   |  Resolution:
 Keywords:  has-patch needs-testing  |     Focuses:
-------------------------------------+------------------------------
Changes (by tyxla):

 * keywords:   => has-patch needs-testing


Comment:

 I was able to reproduce this issue, and I wonder how this wasn't found and
 fixed earlier.

 The solution that @GregLone suggests fixes the issue, as this way the
 default value is always accurate, instead of assuming it is always
 `false`.

 Attached a patch that addresses this issue in both `update_option()` and
 `add_option()`.

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


More information about the wp-trac mailing list