[wp-trac] [WordPress Trac] #35869: Preview of menu items includes unnecessary slashes for users without unfiltered_html

WordPress Trac noreply at wordpress.org
Sun Feb 21 07:38:25 UTC 2016


#35869: Preview of menu items includes unnecessary slashes for users without
unfiltered_html
------------------------------+--------------------------
 Reporter:  ocean90           |       Owner:  westonruter
     Type:  defect (bug)      |      Status:  accepted
 Priority:  normal            |   Milestone:  4.5
Component:  Customize         |     Version:  4.3
 Severity:  normal            |  Resolution:
 Keywords:  has-patch commit  |     Focuses:
------------------------------+--------------------------
Changes (by westonruter):

 * keywords:  needs-patch => has-patch commit


Comment:

 Turns out the issue goes a bit deeper. There is more needed than just
 doing `wp_slash()` before passing into `wp_filter_kses` filter, and then
 calling `wp_unslash()` on the return value of the filter. This handles it
 for the `WP_Customize_Nav_Menu_Item_Setting::sanitize()` logic and
 previewing the change. But when `update` is called, any slashes used in
 the content, e.g. “Yay! \o/” would get saved as “Yay! o/”. So the
 `WP_Customize_Nav_Menu_Item_Setting::update()` method also needs to be
 updated to ensure the setting is passed through `wp_slash()` in its way
 into `wp_update_nav_menu_item()`, and this function needs to be updated to
 note that it expects pre-slashed input (sadly).

 This is all done in [attachment:35869.0.diff].

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


More information about the wp-trac mailing list