WordPress.org

Make WordPress Core

Ticket #20459: 20459.2.patch

File 20459.2.patch, 1.3 KB (added by mordauk, 7 years ago)

Check manage_network_users capability instead of is_super_admin()

  • wp-includes/ms-functions.php

     
    489489        if ( in_array( $user_name, $illegal_names ) == true )
    490490                $errors->add('user_name',  __( 'That username is not allowed.' ) );
    491491
    492         if ( is_email_address_unsafe( $user_email ) )
     492        if ( is_email_address_unsafe( $user_email ) && ! current_user_can( 'manage_network_users' ) )
    493493                $errors->add('user_email',  __('You cannot use that email address to signup. We are having problems with them blocking some of our email. Please use another email provider.'));
    494494
    495495        if ( strlen( $user_name ) < 4 )
     
    506506                $errors->add('user_email', __( 'Please enter a valid email address.' ) );
    507507
    508508        $limited_email_domains = get_site_option( 'limited_email_domains' );
    509         if ( is_array( $limited_email_domains ) && empty( $limited_email_domains ) == false ) {
     509        if ( is_array( $limited_email_domains ) && empty( $limited_email_domains ) == false && ! current_user_can( 'manage_network_users' ) ) {
    510510                $emaildomain = substr( $user_email, 1 + strpos( $user_email, '@' ) );
    511511                if ( in_array( $emaildomain, $limited_email_domains ) == false )
    512512                        $errors->add('user_email', __('Sorry, that email address is not allowed!'));