[wp-trac] [WordPress Trac] #35305: do_meta_boxes() does not display correctly with screen names that contain charaters outside sanatize_key()'s limits

WordPress Trac noreply at wordpress.org
Fri Jun 30 04:17:58 UTC 2017


#35305: do_meta_boxes() does not display correctly with screen names that contain
charaters outside sanatize_key()'s limits
--------------------------------+---------------------------
 Reporter:  GregRoss            |       Owner:  DrewAPicture
     Type:  defect (bug)        |      Status:  closed
 Priority:  normal              |   Milestone:  4.9
Component:  Options, Meta APIs  |     Version:  4.4
 Severity:  normal              |  Resolution:  fixed
 Keywords:  has-patch           |     Focuses:  docs
--------------------------------+---------------------------
Changes (by DrewAPicture):

 * owner:   => DrewAPicture
 * status:  new => closed
 * resolution:   => fixed


Comment:

 In [changeset:"40967"]:
 {{{
 #!CommitTicketReference repository="" revision="40967"
 Docs: Provide best practice guidance for achieving parity between
 `$menu_slug` values supplied when adding menu and submenu pages, and later
 trying to compare those initial values against sanitized screen IDs
 derived from `$menu_slug`.

 At the heart of the matter, the `$menu_slug` parameter in
 `add_menu_page()` and `add_submenu_page()` is not sanitized with
 `sanitize_key()`. When the screen object is later built for the admin
 page, the screen ID is derived from that `$menu_slug` value, though passed
 through `sanitize_key()`, which can produce unexpected results in
 comparison check.

 Changing the sanitization code to provide actual parity is out of the
 question at this juncture, so updating the docs to describe how to avoid
 this edge case is the next best option.

 Props GregRoss.
 Fixes #35305.
 }}}

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


More information about the wp-trac mailing list