Make WordPress Core


Ignore:
Timestamp:
11/29/2019 10:02:30 PM (5 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-includes/rest-api/endpoints/class-wp-rest-users-controller.php

    r46696 r46804  
    11381138        $illegal_logins = (array) apply_filters( 'illegal_user_logins', array() );
    11391139
    1140         if ( in_array( strtolower( $username ), array_map( 'strtolower', $illegal_logins ) ) ) {
     1140        if ( in_array( strtolower( $username ), array_map( 'strtolower', $illegal_logins ), true ) ) {
    11411141            return new WP_Error( 'rest_user_invalid_username', __( 'Sorry, that username is not allowed.' ), array( 'status' => 400 ) );
    11421142        }
Note: See TracChangeset for help on using the changeset viewer.