[wp-trac] [WordPress Trac] #30238: Treat 'FALSE' as false in wp_validate_boolean()

WordPress Trac noreply at wordpress.org
Mon Nov 3 13:41:13 UTC 2014


#30238: Treat 'FALSE' as false in wp_validate_boolean()
-------------------------+------------------
 Reporter:  TobiasBg     |       Owner:
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  4.1
Component:  General      |     Version:  4.0
 Severity:  normal       |  Resolution:
 Keywords:  has-patch    |     Focuses:
-------------------------+------------------

Comment (by kitchin):

 From the patch:
 `if ( 'false' === strtolower( $var ) ) {`

 But `strtolower()` always returns a string so `===` is redundant. A non-
 scalar `$var` (like an object) might cause an error or warning. So I'd
 suggest:
 `if ( is_string( $var ) && 'false' == strtolower( $var ) ) {`

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


More information about the wp-trac mailing list