Make WordPress Core

Ticket #63137: 63137.5.patch

File 63137.5.patch, 1.8 KB (added by viralsampat, 7 months ago)

I have checked above mentioned issue and founds few files. Here, I have added its patch.

  • src/wp-includes/class-wp-application-passwords.php

    diff --git src/wp-includes/class-wp-application-passwords.php src/wp-includes/class-wp-application-passwords.php
    index 6e84e0a2b2..6840dc93f3 100644
    class WP_Application_Passwords { 
    347347                        }
    348348
    349349                        $password['last_used'] = time();
    350                         $password['last_ip']   = $_SERVER['REMOTE_ADDR'];
     350                        $password['last_ip']   = isset( $_SERVER['REMOTE_ADDR'] ) ? $_SERVER['REMOTE_ADDR'] : null;
    351351
    352352                        $saved = static::set_user_application_passwords( $user_id, $passwords );
    353353
  • src/wp-includes/template-loader.php

    diff --git src/wp-includes/template-loader.php src/wp-includes/template-loader.php
    index 0fd08545cc..91a68462a7 100644
    if ( wp_using_themes() ) { 
    2323 *
    2424 * @param bool $exit Whether to exit without generating any content for 'HEAD' requests. Default true.
    2525 */
    26 if ( 'HEAD' === $_SERVER['REQUEST_METHOD'] && apply_filters( 'exit_on_http_head', true ) ) {
     26if ( ( isset( $_SERVER['REQUEST_METHOD'] ) && 'HEAD' === $_SERVER['REQUEST_METHOD'] ) && apply_filters( 'exit_on_http_head', true ) ) {
    2727        exit;
    2828}
    2929
  • src/wp-includes/user.php

    diff --git src/wp-includes/user.php src/wp-includes/user.php
    index 6d53726327..f7f36b1d08 100644
    function retrieve_password( $user_login = '' ) { 
    33033303        $message .= network_site_url( 'wp-login.php?login=' . rawurlencode( $user_login ) . "&key=$key&action=rp", 'login' ) . '&wp_lang=' . $locale . "\r\n\r\n";
    33043304
    33053305        if ( ! is_user_logged_in() ) {
    3306                 $requester_ip = $_SERVER['REMOTE_ADDR'];
     3306                $requester_ip = isset( $_SERVER['REMOTE_ADDR'] ) ? wp_unslash( $_SERVER['REMOTE_ADDR'] ) : '';
    33073307                if ( $requester_ip ) {
    33083308                        $message .= sprintf(
    33093309                                /* translators: %s: IP address of password reset requester. */