Make WordPress Core


Ignore:
Timestamp:
11/29/2019 10:02:30 PM (6 years ago)
Author:
SergeyBiryukov
Message:

REST API: Use strict in_array() checks for the list of usernames blacklisted via illegal_user_logins filter.

See #48839.

File:
1 edited

Legend:

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

    r46640 r46804  
    194194    $illegal_logins = (array) apply_filters( 'illegal_user_logins', array() );
    195195
    196     if ( in_array( strtolower( $user->user_login ), array_map( 'strtolower', $illegal_logins ) ) ) {
     196    if ( in_array( strtolower( $user->user_login ), array_map( 'strtolower', $illegal_logins ), true ) ) {
    197197        $errors->add( 'invalid_username', __( '<strong>ERROR</strong>: Sorry, that username is not allowed.' ) );
    198198    }
Note: See TracChangeset for help on using the changeset viewer.