WordPress.org

Make WordPress Core

Ticket #15706: 15706.2.patch

File 15706.2.patch, 1.0 KB (added by SergeyBiryukov, 3 years ago)
  • wp-includes/ms-functions.php

     
    565565 
    566566        $limited_email_domains = get_site_option( 'limited_email_domains' ); 
    567567        if ( is_array( $limited_email_domains ) && empty( $limited_email_domains ) == false ) { 
    568                 $emaildomain = substr( $user_email, 1 + strpos( $user_email, '@' ) ); 
    569                 if ( in_array( $emaildomain, $limited_email_domains ) == false ) 
     568                $email_domain = substr( $user_email, 1 + strpos( $user_email, '@' ) ); 
     569                $matched_domain = false;  
     570 
     571                foreach ( (array) $limited_email_domains as $limited_domain ) { 
     572                        if ( $limited_domain == '' ) 
     573                                continue; 
     574 
     575                        if ( strstr( $email_domain, $limited_domain ) || ( strstr( $limited_domain, '/' ) && preg_match( $limited_domain, $email_domain ) ) ) 
     576                                $matched_domain = true; 
     577                } 
     578 
     579                if ( ! $matched_domain ) 
    570580                        $errors->add('user_email', __('Sorry, that email address is not allowed!')); 
    571581        } 
    572582