General: Properly escape home_url() links in wp_page_menu().

Props sabbirmc, tushar284, costdev.
Fixes 56148.

git-svn-id: https://develop.svn.wordpress.org/trunk@53656 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Jonathan Desrosiers
2022-07-05 14:12:06 +00:00
parent 2db7debe8a
commit 1aac5a843c

View File

@@ -1443,7 +1443,7 @@ function wp_page_menu( $args = array() ) {
if ( is_front_page() && ! is_paged() ) {
$class = 'class="current_page_item"';
}
$menu .= '<li ' . $class . '><a href="' . home_url( '/' ) . '">' . $args['link_before'] . $text . $args['link_after'] . '</a></li>';
$menu .= '<li ' . $class . '><a href="' . esc_url( home_url( '/' ) ) . '">' . $args['link_before'] . $text . $args['link_after'] . '</a></li>';
// If the front page is a page, add it to the exclude list.
if ( 'page' === get_option( 'show_on_front' ) ) {
if ( ! empty( $list_args['exclude'] ) ) {