#17409 closed defect (bug) (invalid)
Entity & in menu title breaks XHTML 1.0 Strict validation
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | normal | Version: | 3.1.2 |
| Component: | Menus | Keywords: | |
| Focuses: | Cc: |
Description
If i use & in the menu title and use $my_menu = wp_get_nav_menu_items("my_menu") and loop with foreach($my_menu as $menu_item) and connect for building the Menu on $menu_item->title, then an & in the page title or on the menu navigation label is convertet to a simple &, witch returns the validation error "xmlParseEntityRef: no name".
Change History (4)
This ticket was mentioned in IRC in #wordpress-dev by Steve_p. View the logs.
12 years ago
#3
follow-up:
↓ 4
@
12 years ago
- Keywords close added
- Resolution set to invalid
- Status changed from new to closed
#4
in reply to:
↑ 3
@
12 years ago
- Keywords close removed
- Milestone Awaiting Review deleted
Replying to Steve_p:
When using $menu_item->menu_title directly, you need to use esc_html() to encode HTML entities correctly.
Or, as wp_nav_menu() and his Walker, do apply_filters( 'the_title', $menu_item->menu_title, $menu_item->ID ).
Note: See
TracTickets for help on using
tickets.
Thanks for the report and sorry for taking so long to get back to you. This does not seem to be a bug. When using $menu_item->menu_title directly, you need to use esc_html() to encode HTML entities correctly.