Changeset 40595
- Timestamp:
- 05/09/2017 04:54:52 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/ms-functions.php
r40594 r40595 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 ); -
trunk/tests/phpunit/tests/multisite/isEmailAddressUnsafe.php
r32646 r40595 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
Note: See TracChangeset
for help on using the changeset viewer.