Make WordPress Core

Ticket #63188: 63188.2.patch

File 63188.2.patch, 763 bytes (added by viralsampat, 10 months ago)

I have updated my patch and changed variable name as per requirement.

  • src/wp-includes/class-wp-session-tokens.php

    diff --git src/wp-includes/class-wp-session-tokens.php src/wp-includes/class-wp-session-tokens.php
    index 9482e1b948..4371285836 100644
    abstract class WP_Session_Tokens { 
    129129                $session               = apply_filters( 'attach_session_information', array(), $this->user_id );
    130130                $session['expiration'] = $expiration;
    131131
     132                // Get the IP address and user-agent.
     133                $remote_addr = filter_input(INPUT_SERVER, 'REMOTE_ADDR', FILTER_VALIDATE_IP);
     134               
    132135                // IP address.
    133                 if ( ! empty( $_SERVER['REMOTE_ADDR'] ) ) {
    134                         $session['ip'] = $_SERVER['REMOTE_ADDR'];
     136                if ( ! empty( $remote_addr ) ) {
     137                        $session['ip'] = $remote_addr;
    135138                }
    136139
    137140                // User-agent.