[wp-trac] Re: [WordPress Trac] #9862: checked/selected helper confuses '0' and ''

WordPress Trac wp-trac at lists.automattic.com
Fri Jun 26 19:23:38 GMT 2009


#9862: checked/selected helper confuses '0' and ''
-------------------------------+--------------------------------------------
 Reporter:  Denis-de-Bernardy  |        Owner:  westi   
     Type:  defect (bug)       |       Status:  reopened
 Priority:  low                |    Milestone:  2.8.2   
Component:  Administration     |      Version:  2.8     
 Severity:  normal             |   Resolution:          
 Keywords:  has-patch commit   |  
-------------------------------+--------------------------------------------
Changes (by Denis-de-Bernardy):

  * keywords:  has-patch => has-patch commit


Comment:

 @westi. As highlighted in my comment above, the issue is this:

 {{{
 <p>Your Preference</p>
 <?php $var = 0; ?>
 <select>
 <option value="" <?php checked($var, ''); ?>>Site Default</option>
 <option value="1" <?php checked($var, 1); ?>>Yes</option>
 <option value="0" <?php checked($var, 0); ?>>No</option>
 </select>
 }}}

 The change affect nothing in the WP code. But it's still a bug.

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


More information about the wp-trac mailing list