Closed scribu closed 11 years ago
Minimal code to reproduce:
echo scbForms::input( array( 'name' => 'whatever', 'type' => 'select', 'choices' => array( '1/2', '1', '1 1/3', ), 'selected' => '1 1/3' ) );
Result:
<label><select name="whatever"> <option value="1/2">1/2</option> <option value="1" selected="selected">1</option> <option value="1 1/3" selected="selected">1 1/3</option> </select></label>
A user reported this bug against P2P:
http://wordpress.org/support/topic/issue-with-selects-on-the-post-editor
Somehow, '1' gets casted to an integer, and in PHP, 1 == '1 1/3' is true, because why not?
'1'
1 == '1 1/3'
true
Minimal code to reproduce:
Result:
A user reported this bug against P2P:
http://wordpress.org/support/topic/issue-with-selects-on-the-post-editor