From 585f623b4d4611d6200357271bf276c83136711d Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Tue, 14 Jul 2020 11:52:43 +0000 Subject: [PATCH] Sitemaps: Add missing slash when calling `home_url()` for consistency. Props Chouby. Fixes #50570. git-svn-id: https://develop.svn.wordpress.org/trunk@48472 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/sitemaps/providers/class-wp-sitemaps-posts.php | 2 +- tests/phpunit/tests/sitemaps/sitemaps.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wp-includes/sitemaps/providers/class-wp-sitemaps-posts.php b/src/wp-includes/sitemaps/providers/class-wp-sitemaps-posts.php index 3ec20bf23f..233396b7f8 100644 --- a/src/wp-includes/sitemaps/providers/class-wp-sitemaps-posts.php +++ b/src/wp-includes/sitemaps/providers/class-wp-sitemaps-posts.php @@ -101,7 +101,7 @@ class WP_Sitemaps_Posts extends WP_Sitemaps_Provider { if ( 'page' === $post_type && 1 === $page_num && 'posts' === get_option( 'show_on_front' ) ) { // Extract the data needed for home URL to add to the array. $sitemap_entry = array( - 'loc' => home_url(), + 'loc' => home_url( '/' ), ); /** diff --git a/tests/phpunit/tests/sitemaps/sitemaps.php b/tests/phpunit/tests/sitemaps/sitemaps.php index 16a259c298..d393543ec0 100644 --- a/tests/phpunit/tests/sitemaps/sitemaps.php +++ b/tests/phpunit/tests/sitemaps/sitemaps.php @@ -234,7 +234,7 @@ class Test_Sitemaps extends WP_UnitTestCase { array_unshift( $expected, array( - 'loc' => home_url(), + 'loc' => home_url( '/' ), ) );