WordPress.org

Make WordPress Core

Ticket #20176: ms-functions.2.diff

File ms-functions.2.diff, 815 bytes (added by webord, 4 years ago)

With the Filter for the error message

  • 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] ) { 
    443                 $errors->add( 'user_name', __( 'Only lowercase letters (a-z) and numbers are allowed.' ) ); 
     443                $errors->add( 'user_name', apply_filters( 'wpmu_username_restriction_message', __( 'Only lowercase letters (a-z) and numbers are allowed.' ) ) ); 
    444444                $user_name = $orig_username; 
    445445        } 
    446446