[wp-trac] [WordPress Trac] #14184: empty() and "0" in class-http.php

WordPress Trac wp-trac at lists.automattic.com
Sun Jul 4 05:11:42 UTC 2010


#14184: empty() and "0" in class-http.php
--------------------------+-------------------------------------------------
 Reporter:  mailnew2ster  |       Owner:                         
     Type:  defect (bug)  |      Status:  new                    
 Priority:  normal        |   Milestone:  Awaiting Review        
Component:  HTTP          |     Version:                         
 Severity:  normal        |    Keywords:  has-patch needs-testing
--------------------------+-------------------------------------------------

Comment(by mailnew2ster):

 Most of them are. empty() is used, for example, to check whether the
 response is empty, which "0" is not, etc.
 As of $length = hexdec( $match[1] );, empty() used there to check for "0",
 but it does not return true for, eg., "00", thus it's better to use hexdec
 first, and then check the integer for 0.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/14184#comment:2>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list