Make WordPress Core

Ticket #50044: 50044.patch

File 50044.patch, 1.3 KB (added by sh4lin, 13 months ago)

has-patch

  • src/wp-includes/feed.php

    From f060a65a592caca8c11f1fae2e070da3b640ad07 Mon Sep 17 00:00:00 2001
    From: Shalin Shah <sahilshh723@gmail.com>
    Date: Tue, 23 May 2023 18:16:40 +0530
    Subject: [PATCH] Concatenation is replaced with the sprintf()
    
    ---
     src/wp-includes/feed.php | 22 +++++++++++++++-------
     1 file changed, 15 insertions(+), 7 deletions(-)
    
    diff --git a/src/wp-includes/feed.php b/src/wp-includes/feed.php
    index 6972f0ce75..c703a05a3a 100644
    a b function rss2_site_icon() { 
    658658 * @return string Correct link for the atom:self element.
    659659 */
    660660function get_self_link() {
    661         $host = parse_url( home_url() );
    662         $url  = '';
     661        $host   = parse_url( home_url() );
     662        $scheme = 'http://';
    663663        if ( isset( $host['scheme'] ) ) {
    664                 $url .= "{$host['scheme']}://";
     664                $scheme = "{$host['scheme']}://";
    665665        }
    666         $url .= $host['host'];
     666        $port = '';
    667667        if ( isset( $host['port'] ) ) {
    668                 $url .= ":{$host['port']}";
     668                $port = ":{$host['port']}";
    669669        }
    670         $url .= wp_unslash( $_SERVER['REQUEST_URI'] );
    671         return set_url_scheme( $url );
     670        $request_uri = wp_unslash( $_SERVER['REQUEST_URI'] );
     671        return set_url_scheme(
     672                sprintf(
     673                        '%1$s%2$s%3$s%4$s',
     674                        $scheme,
     675                        $host['host'],
     676                        $port,
     677                        $request_uri
     678                )
     679        );
    672680}
    673681
    674682/**