WordPress 4.3.1
[autoinstalls/wordpress.git] / wp-includes / category-template.php
index d29ae479ec6766c7ace5724bad5183b5ba9cd69e..6bac6c11b7ae4adf0b780defc8b1a15108f19172 100644 (file)
@@ -1207,7 +1207,8 @@ class Walker_CategoryDropdown extends Walker {
 
                $output .= "\t<option class=\"level-$depth\" value=\"" . esc_attr( $category->{$value_field} ) . "\"";
 
-               if ( $category->{$value_field} == $args['selected'] )
+               // Type-juggling causes false matches, so we force everything to a string.
+               if ( (string) $category->{$value_field} === (string) $args['selected'] )
                        $output .= ' selected="selected"';
                $output .= '>';
                $output .= $pad.$cat_name;