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

WordPress Trac wp-trac at lists.automattic.com
Sun Jul 4 15:28:18 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 jacobsantos):

 These look as if they need to be fixed as well, meaning the patch does so.
  1. Line 1738
  1. Line 1817 (second empty)

 Question: Do you think we are amateurs and don't realize proper string

 I will repeat, many of the empty checks aren't simply checking for an
 empty string. Some of the checks are also checking for existence and if
 you were to do that comparison, it would require adding an isset() check.
 Some of the checks are also to prevent having to go back and correct
 server configurations that give the wrong data.

 In the case of content-encoding, what if the server decides that 0 is the
 way for the server to say that there is none. If we're to use your 'fix',
 then we'd have to drill down first what is causing the problem and then
 change it back. The header is a good point, some custom headers might use
 0 as a legitimate value and cookie values probably might use it as well.
 Everything else, I'd leave as is.

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

More information about the wp-trac mailing list