Making WordPress.org

Changeset 10949


Ignore:
Timestamp:
05/05/2021 12:21:02 AM (5 years ago)
Author:
dd32
Message:

Login: Cast the pending user int fields to ints.

This fixes some signup attempts that would fail after being manually approved, as 2 !== '2'.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/functions-registration.php

    r10941 r10949  
    211211        $pending_user['meta']   = json_decode( $pending_user['meta'], true );
    212212        $pending_user['scores'] = json_decode( $pending_user['scores'], true );
     213
     214        // Cast the int fields to an integer.
     215        foreach ( [ 'pending_id', 'cleared', 'created' ] as $field ) {
     216                $pending_user[ $field ] = (int) $pending_user[ $field ];
     217        }
    213218
    214219        return $pending_user;
Note: See TracChangeset for help on using the changeset viewer.