[wp-trac] [WordPress Trac] #14184: HTTP API is not allowing '0' for headers and cookies.

WordPress Trac wp-trac at lists.automattic.com
Sat Jul 7 05:16:44 UTC 2012


#14184: HTTP API is not allowing '0' for headers and cookies.
-------------------------------------+-----------------------------
 Reporter:  mailnew2ster             |       Owner:  dd32
     Type:  defect (bug)             |      Status:  accepted
 Priority:  normal                   |   Milestone:  Future Release
Component:  HTTP                     |     Version:
 Severity:  normal                   |  Resolution:
 Keywords:  has-patch needs-testing  |
-------------------------------------+-----------------------------
Changes (by dd32):

 * owner:   => dd32
 * status:  new => accepted


Comment:

 After testing cases around using "empty" values in headers and cookies,
 the only place I've been able to verify a bug exists, is sending a cookie
 such as 'test=0', as the 0 trips the empty() check, causing no cookie to
 be sent to the server (This doesn't affect receiving headers).

 As a result, The last chunk of 14184.2.diff is needed.

 The 1st/2nd chunk revolving around {{{!empty( $value )}}} causes a bug
 where headers in the format of 'header: 0' fail to be returned, the change
 doesn't seem to fix any cases I can find.

 The 2nd last chunk around {{{if ( empty($pair) )}}} is also not needed, as
 only non-empty values should ever exist within a cookie pair (That being,
 a 'key=name" combination, The only case this would fix would be a 0
 standing alone in the cookie value  - something that should not happen,
 and therefor is safe to discard. )

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


More information about the wp-trac mailing list