#17217 closed defect (bug) (fixed)
Walker_PageDropdown doesn't filter titles correctly
Reported by: | Otto42 | Owned by: | |
---|---|---|---|
Milestone: | 3.1.2 | Priority: | normal |
Severity: | normal | Version: | 3.1 |
Component: | Administration | Keywords: | has-patch |
Focuses: | Cc: |
Description (last modified by )
The Walker_PageDropdown has this code:
$title = esc_html($page->post_title); $title = apply_filters( 'list_pages', $page->post_title );
Meaning that the esc_html is not applied properly, since $title just gets replaces with the $post_title again.
Fix is this:
$title = esc_html($page->post_title); $title = apply_filters( 'list_pages', $title );
Patch attached.
Attachments (1)
Change History (7)
Note: See
TracTickets for help on using
tickets.
Going to tweak this a bit. Instead moving the esc_html() to after the filter, consistent with escaping as late as possible and also still passing post_title unescaped to the filter, as before.