Make WordPress Core

Ticket #39645: 39645.3.diff

File 39645.3.diff, 907 bytes (added by noam@…, 4 years ago)
  • wp-includes/user.php

     
    30893089        // Check the username.
    30903090        if ( '' === $sanitized_user_login ) {
    30913091                $errors->add( 'empty_username', __( '<strong>Error</strong>: Please enter a username.' ) );
     3092        }
     3093        // Prevent the use of 'admin' username to help combat brute force attempts.
     3094          elseif ( strtolower( $sanitized_user_login ) == 'admin' ) {   
     3095                $errors->add( 'invalid_username', __( '<strong>Error</strong>: This username is invalid for security reasons. Please enter a valid username.' ) );
    30923096        } elseif ( ! validate_username( $user_login ) ) {
    30933097                $errors->add( 'invalid_username', __( '<strong>Error</strong>: This username is invalid because it uses illegal characters. Please enter a valid username.' ) );
    30943098                $sanitized_user_login = '';