diff --git a/wp-includes/feed.php b/wp-includes/feed.php index 7b4046b22a..dafd3a2551 100644 --- a/wp-includes/feed.php +++ b/wp-includes/feed.php @@ -615,6 +615,18 @@ function rss2_site_icon() { } } +/** + * Returns the link for the currently displayed feed. + * + * @since 5.3.0 + * + * @return string Correct link for the atom:self element. + */ +function get_self_link() { + $host = @parse_url( home_url() ); + return set_url_scheme( 'http://' . $host['host'] . wp_unslash( $_SERVER['REQUEST_URI'] ) ); +} + /** * Display the link for the currently displayed feed in a XSS safe way. * @@ -623,7 +635,6 @@ function rss2_site_icon() { * @since 2.5.0 */ function self_link() { - $host = @parse_url( home_url() ); /** * Filters the current feed URL. * @@ -634,7 +645,7 @@ function self_link() { * * @param string $feed_link The link for the feed with set URL scheme. */ - echo esc_url( apply_filters( 'self_link', set_url_scheme( 'http://' . $host['host'] . wp_unslash( $_SERVER['REQUEST_URI'] ) ) ) ); + echo esc_url( apply_filters( 'self_link', get_self_link() ) ); } /** diff --git a/wp-includes/version.php b/wp-includes/version.php index 4142bc0fc9..832abe7e28 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.3-alpha-45771'; +$wp_version = '5.3-alpha-45772'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.