[wp-trac] [WordPress Trac] #32056: wp_dropdown_roles() bug

WordPress Trac noreply at wordpress.org
Wed Apr 22 11:59:26 UTC 2015


#32056: wp_dropdown_roles() bug
-----------------------------+-----------------------------
 Reporter:  InS0mN1aC        |      Owner:
     Type:  defect (bug)     |     Status:  new
 Priority:  normal           |  Milestone:  Awaiting Review
Component:  Role/Capability  |    Version:  4.1.2
 Severity:  normal           |   Keywords:
  Focuses:  administration   |
-----------------------------+-----------------------------
 Hello, in the function wp_dropdown_roles() located in wp-
 admin/includes/template.php there is a bug.

 More specifically, around line 855 you can find
 {{{
 if ( $selected == $role ) // preselect specified role
 }}}

 In this condition you are comparing 2 strings, therefore the correct
 operator for comparison is "===". If compared only with "==" then the
 preselected role is wrong if the site has custom roles. Also the {}
 brackets are missing, but this is ok...

 Please consider fixing it in the next version :)

--
Ticket URL: <https://core.trac.wordpress.org/ticket/32056>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list