Making WordPress.org

Changeset 13288


Ignore:
Timestamp:
03/07/2024 02:18:00 AM (2 years ago)
Author:
dd32
Message:

Registration: Fix the IP lookup query on query failure.

See [13216].

Location:
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/admin/class-user-registrations-list-table.php

    r13216 r13288  
    383383                        $ip = $meta->{$field . '_ip'};
    384384
    385                         $meta->{$field . '_ip_country'} ??= ( is_callable( 'WordPressdotorg\GeoIP\query' ) ? ' ' . \WordPressdotorg\GeoIP\query( $ip, 'country_short' ) : '' );
     385                        if ( empty( $meta->{$field . '_ip_country'} ) ) {
     386                                $meta->{$field . '_ip_country'} = ( is_callable( 'WordPressdotorg\GeoIP\query' ) ? \WordPressdotorg\GeoIP\query( $ip, 'country_short' ) : '' );
     387                        }
    386388
    387389                        $ips[] = $ip . ' ' . $meta->{$field . '_ip_country'};
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/functions-registration.php

    r13216 r13288  
    8383                'meta' => $meta + array(
    8484                        'registration_ip'  => $_SERVER['REMOTE_ADDR'], // Spam & fraud control. Will be discarded after the account is created.
    85                         'registration_ip_country' => ( is_callable( 'WordPressdotorg\GeoIP\query' ) ? ' ' . \WordPressdotorg\GeoIP\query( $_SERVER['REMOTE_ADDR'], 'country_short' ) : '' )
     85                        'registration_ip_country' => ( is_callable( 'WordPressdotorg\GeoIP\query' ) ? \WordPressdotorg\GeoIP\query( $_SERVER['REMOTE_ADDR'], 'country_short' ) : '' )
    8686                ),
    8787                'scores' => array(
     
    337337        $pending_user['created_date']                 = gmdate( 'Y-m-d H:i:s' );
    338338        $pending_user['meta']['confirmed_ip']         = $_SERVER['REMOTE_ADDR'];
    339         $pending_user['meta']['confirmed_ip_country'] = ( is_callable( 'WordPressdotorg\GeoIP\query' ) ? ' ' . \WordPressdotorg\GeoIP\query( $_SERVER['REMOTE_ADDR'], 'country_short' ): '' );
     339        $pending_user['meta']['confirmed_ip_country'] = ( is_callable( 'WordPressdotorg\GeoIP\query' ) ? \WordPressdotorg\GeoIP\query( $_SERVER['REMOTE_ADDR'], 'country_short' ): '' );
    340340
    341341        // reCaptcha v3 logging.
Note: See TracChangeset for help on using the changeset viewer.