Make WordPress Core


Ignore:
Timestamp:
03/17/2020 07:19:05 PM (5 years ago)
Author:
SergeyBiryukov
Message:

Menus: When adding a label for special pages in wp_setup_nav_menu_item() strip all HTML tags, as the label is escaped on output.

Follow-up to [47211], [47213].

Props stiofansisland.
Reviewed by whyisjake, SergeyBiryukov.
Merges [47458] to the 5.4 branch.
Fixes #49374.

Location:
branches/5.4
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/5.4

  • branches/5.4/src/wp-includes/nav-menu.php

    r47213 r47465  
    823823                        $post_states = get_post_states( $menu_post );
    824824                        if ( $post_states ) {
    825                             $menu_item->type_label = implode( ',', $post_states );
     825                            $menu_item->type_label = wp_strip_all_tags( implode( ', ', $post_states ) );
    826826                        }
    827827                    }
Note: See TracChangeset for help on using the changeset viewer.