WordPress.org

Make WordPress Core

Ticket #48011: 48011-1.patch

File 48011-1.patch, 1.6 KB (added by achyuthajoy, 2 months ago)
  • src/wp-includes/nav-menu.php

    From 4f0626ba8bef7a8a803860e51fa8ed396027d9eb Mon Sep 17 00:00:00 2001
    From: Achyuth Ajoy <achyuthajoy@gmail.com>
    Date: Thu, 12 Sep 2019 15:36:49 -0400
    Subject: [PATCH 1/2] Added special character decode to menu item title
    
    ---
     src/wp-includes/nav-menu.php | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/src/wp-includes/nav-menu.php b/src/wp-includes/nav-menu.php
    index f130d2f3e1..db8a2fcf78 100644
    a b function wp_update_nav_menu_item( $menu_id = 0, $menu_item_db_id = 0, $menu_item 
    484484                        }
    485485                }
    486486
    487                 if ( $args['menu-item-title'] == $original_title ) {
     487                if ( $args['menu-item-title'] == wp_specialchars_decode( $original_title ) ) {
    488488                        $args['menu-item-title'] = '';
    489489                }
    490490
  • src/wp-includes/nav-menu.php

    -- 
    2.23.0
    
    
    From 130812f3c2f3ff20113d98dd48af4f7300cbffee Mon Sep 17 00:00:00 2001
    From: Achyuth Ajoy <achyuthajoy@gmail.com>
    Date: Thu, 12 Sep 2019 19:00:30 -0400
    Subject: [PATCH 2/2] Add wp_unslash to menu item title argument to match with
     DB data
    
    ---
     src/wp-includes/nav-menu.php | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/src/wp-includes/nav-menu.php b/src/wp-includes/nav-menu.php
    index db8a2fcf78..a99ddb3cef 100644
    a b function wp_update_nav_menu_item( $menu_id = 0, $menu_item_db_id = 0, $menu_item 
    484484                        }
    485485                }
    486486
    487                 if ( $args['menu-item-title'] == wp_specialchars_decode( $original_title ) ) {
     487                if ( wp_unslash( $args['menu-item-title'] ) == wp_specialchars_decode( $original_title ) ) {
    488488                        $args['menu-item-title'] = '';
    489489                }
    490490