[wp-trac] [WordPress Trac] #40927: Passing a float as the position in add_menu_page can override other menu items

WordPress Trac noreply at wordpress.org
Fri Apr 29 11:40:36 UTC 2022


#40927: Passing a float as the position in add_menu_page can override other menu
items
-------------------------------------------------+-------------------------
 Reporter:  justinbusa                           |       Owner:
                                                 |  SergeyBiryukov
     Type:  defect (bug)                         |      Status:  reopened
 Priority:  normal                               |   Milestone:  6.0
Component:  Administration                       |     Version:  4.8
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch dev-feedback needs-        |     Focuses:
  testing has-unit-tests                         |  administration
-------------------------------------------------+-------------------------
Changes (by david.binda):

 * status:  closed => reopened
 * resolution:  fixed =>


Comment:

 Sorry for re-opening. But the logic for computing the `$collision_avoider`
 has changed in the latest patch.

 {{{#!php
 base_convert( substr( md5( $menu_slug . $menu_title ), -4 ), 16, 10 ) *
 0.00001;
 }}}

 vs. original:

 {{{#!php
 substr( base_convert( md5( $menu_slug . $menu_title ), 16, 10 ), -5 ) *
 0.00001;
 }}}

 and those give different results. I wonder, is this change intentional?

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/40927#comment:39>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list