WordPress.org

Make WordPress Core

Ticket #44838: 44838.3.diff

File 44838.3.diff, 1.3 KB (added by donmhico, 3 months ago)

Refresh the patch.

  • src/wp-includes/feed.php

    diff --git src/wp-includes/feed.php src/wp-includes/feed.php
    index bd0c06fc25..ed36765121 100644
    function rss2_site_icon() { 
    616616}
    617617
    618618/**
    619  * Display the link for the currently displayed feed in a XSS safe way.
    620  *
    621  * Generate a correct link for the atom:self element.
     619 * Returns the link for the currently displayed feed in a XSS safe way.
    622620 *
    623  * @since 2.5.0
     621 * @return string Correct link for the atom:self element.
     622 *
     623 * @since 5.3
    624624 */
    625 function self_link() {
     625function get_self_link() {
    626626        $host = @parse_url( home_url() );
    627627        /**
    628628         * Filters the current feed URL.
    function self_link() { 
    634634         *
    635635         * @param string $feed_link The link for the feed with set URL scheme.
    636636         */
    637         echo esc_url( apply_filters( 'self_link', set_url_scheme( 'http://' . $host['host'] . wp_unslash( $_SERVER['REQUEST_URI'] ) ) ) );
     637        return esc_url( apply_filters( 'self_link', set_url_scheme( 'http://' . $host['host'] . wp_unslash( $_SERVER['REQUEST_URI'] ) ) ) );
     638}
     639
     640/**
     641 * Display the link for the currently displayed feed in a XSS safe way.
     642 *
     643 * Generate a correct link for the atom:self element.
     644 *
     645 * @since 2.5.0
     646 */
     647function self_link() {
     648        echo esc_url( get_self_link() );
    638649}
    639650
    640651/*