Ticket #39915: 39915.2.diff
File 39915.2.diff, 1.4 KB (added by , 7 years ago) |
---|
-
src/wp-includes/ms-functions.php
354 354 355 355 $is_email_address_unsafe = false; 356 356 357 if ( $banned_names && is_array( $banned_names ) ) {357 if ( $banned_names && is_array( $banned_names ) && false !== strpos( $user_email, '@', 1 ) ) { 358 358 $banned_names = array_map( 'strtolower', $banned_names ); 359 359 $normalized_email = strtolower( $user_email ); 360 360 -
tests/phpunit/tests/multisite/isEmailAddressUnsafe.php
120 120 ), 121 121 ); 122 122 } 123 124 public function test_email_with_only_top_level_domain_returns_safe() { 125 update_site_option( 'banned_email_domains', 'bar.com' ); 126 $safe = is_email_address_unsafe( 'email@localhost' ); 127 delete_site_option( 'banned_email_domains' ); 128 129 $this->assertFalse( $safe ); 130 } 131 132 public function test_invalid_email_without_domain_returns_safe() { 133 update_site_option( 'banned_email_domains', 'bar.com' ); 134 $safe = is_email_address_unsafe( 'invalid-email' ); 135 delete_site_option( 'bar.com' ); 136 137 $this->assertFalse( $safe ); 138 } 123 139 } 124 140 125 141 endif;