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

Props sabbirmc, tushar284, costdev.
Fixes 56148.
Built from https://develop.svn.wordpress.org/trunk@53656


git-svn-id: http://core.svn.wordpress.org/trunk@53215 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
desrosj 2022-07-05 14:14:21 +00:00
parent 6e619966a6
commit 9635543e0f
2 changed files with 2 additions and 2 deletions

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'] ) ) {

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.1-alpha-53655';
$wp_version = '6.1-alpha-53656';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.