WordPress.org

Make WordPress Core

Ticket #47704: 47704-wp_update_user.patch

File 47704-wp_update_user.patch, 1.1 KB (added by jrf, 12 months ago)

PHP 7.4/array-access: Fix wp_update_user() - fixes 2 errors

  • src/wp-includes/user.php

    From 566350351233419104eed2d688da15aeb673ff23 Mon Sep 17 00:00:00 2001
    From: jrfnl <jrfnl@users.noreply.github.com>
    Date: Mon, 15 Jul 2019 01:05:12 +0200
    Subject: [PATCH] PHP 7.4/array-access: Fix wp_update_user()
    
    ---
     src/wp-includes/user.php | 5 ++++-
     1 file changed, 4 insertions(+), 1 deletion(-)
    
    diff --git a/src/wp-includes/user.php b/src/wp-includes/user.php
    index 3d2bf939d4..fab14519df 100644
    a b All at ###SITENAME### 
    20882088                        $logged_in_cookie = wp_parse_auth_cookie( '', 'logged_in' );
    20892089                        /** This filter is documented in wp-includes/pluggable.php */
    20902090                        $default_cookie_life = apply_filters( 'auth_cookie_expiration', ( 2 * DAY_IN_SECONDS ), $ID, false );
    2091                         $remember            = ( ( $logged_in_cookie['expiration'] - time() ) > $default_cookie_life );
     2091                        $remember            = false;
     2092                        if ( false !== $logged_in_cookie && ( $logged_in_cookie['expiration'] - time() ) > $default_cookie_life ) {
     2093                                $remember = true;
     2094                        }
    20922095
    20932096                        wp_set_auth_cookie( $ID, $remember );
    20942097                }