Make WordPress Core


Ignore:
Timestamp:
10/14/2024 09:14:49 PM (16 months ago)
Author:
SergeyBiryukov
Message:

Users: Further adjust the check for use_ssl meta in wp_insert_user().

This removes a redundant check for a falsey value, which is equivalent to the empty() check directly before.

Includes minor adjustments in the unit test:

  • Adding a @covers tag.
  • Correcting the description for clarity.
  • Using assertSame() for strict type checking.

Follow-up to [59216].

See #60299.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/user.php

    r59216 r59232  
    23672367    $meta['admin_color'] = preg_replace( '|[^a-z0-9 _.\-@]|i', '', $admin_color );
    23682368
    2369     $meta['use_ssl'] = empty( $userdata['use_ssl'] ) || ! $userdata['use_ssl'] ? '0' : '1';
     2369    $meta['use_ssl'] = empty( $userdata['use_ssl'] ) ? '0' : '1';
    23702370
    23712371    $meta['show_admin_bar_front'] = empty( $userdata['show_admin_bar_front'] ) ? 'true' : $userdata['show_admin_bar_front'];
Note: See TracChangeset for help on using the changeset viewer.