Make WordPress Core

Ticket #40169: 40169.diff

File 40169.diff, 658 bytes (added by lukecavanagh, 7 years ago)

Basic patch

  • src/wp-includes/ms-functions.php

     
    415415        $orig_username = $user_name;
    416416        $user_name = preg_replace( '/\s+/', '', sanitize_user( $user_name, true ) );
    417417
    418         if ( $user_name != $orig_username || preg_match( '/[^a-z0-9]/', $user_name ) ) {
     418        if ( $user_name != $orig_username || preg_match( '/[^a-z0-9 _.\-@]/', $user_name ) ) {
    419419                $errors->add( 'user_name', __( 'Usernames can only contain lowercase letters (a-z) and numbers.' ) );
    420420                $user_name = $orig_username;
    421421        }