WordPress.org

Make WordPress Core

Ticket #44838: 44838.2.diff

File 44838.2.diff, 1.2 KB (added by jojotjebaby, 14 months ago)

Changed the patch to add a new function get_self_link that is called and echoed by self_link

  • src/wp-includes/feed.php

    diff --git a/src/wp-includes/feed.php b/src/wp-includes/feed.php
    index c8f5fd5d3d..01dcc9deb8 100644
    a b function rss2_site_icon() { 
    616616}
    617617
    618618/**
    619  * Display the link for the currently displayed feed in a XSS safe way.
     619 * Returns the link for the currently displayed feed in a XSS safe way.
    620620 *
    621621 * Generate a correct link for the atom:self element.
    622622 *
    623  * @since 2.5.0
     623 * @since 4.9.9
    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 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/**