WordPress.org

Make WordPress Core

Ticket #20176: ms-functions.diff

File ms-functions.diff, 626 bytes (added by webord, 3 years ago)

Changes to the wpmu_validate_user_signup

  • ms-functions.php

    old new  
    437437        $orig_username = $user_name; 
    438438        $user_name = preg_replace( '/\s+/', '', sanitize_user( $user_name, true ) ); 
    439439        $maybe = array(); 
    440         preg_match( '/[a-z0-9]+/', $user_name, $maybe ); 
     440        preg_match( apply_filters( 'wpmu_username_restriction', '/[a-z0-9]+/' ), $user_name, $maybe ); 
    441441 
    442442        if ( $user_name != $orig_username || $user_name != $maybe[0] ) { 
    443443                $errors->add( 'user_name', __( 'Only lowercase letters (a-z) and numbers are allowed.' ) );