Ticket #21570: 21570.2.diff
File 21570.2.diff, 1.6 KB (added by , 13 years ago) |
---|
-
wp-includes/ms-functions.php
375 375 */ 376 376 function is_email_address_unsafe( $user_email ) { 377 377 $banned_names = get_site_option( 'banned_email_domains' ); 378 if ( $banned_names && !is_array( $banned_names ))379 $banned_names = explode( "\n", $banned_names );378 if ( $banned_names && !is_array( $banned_names ) ) 379 $banned_names = explode( "\n", $banned_names ); 380 380 381 if ( is_array( $banned_names ) && empty( $banned_names ) == false ) { 382 $email_domain = strtolower( substr( $user_email, 1 + strpos( $user_email, '@' ) ) ); 381 $is_email_address_unsafe = false; 382 383 if ( is_array( $banned_names ) && $banned_names ) { 384 list( $email_local_part, $email_domain ) = explode( '@', $user_email ); 385 383 386 foreach ( (array) $banned_names as $banned_domain ) { 384 if ( $banned_domain == '' )387 if ( !$banned_domain ) { 385 388 continue; 386 if ( 387 strstr( $email_domain, $banned_domain ) || 388 ( 389 strstr( $banned_domain, '/' ) && 390 preg_match( $banned_domain, $email_domain ) 391 ) 392 ) 393 return true; 389 } 390 391 if ( $email_domain == $banned_domain ) { 392 $is_email_address_unsafe = true; 393 break; 394 } 395 396 $dotted_domain = ".$banned_domain"; 397 if ( $dotted_domain === substr( $user_email, -strlen( $dotted_domain ) ) ) { 398 $is_email_address_unsafe = true; 399 break; 400 } 394 401 } 395 402 } 396 return false; 403 404 return apply_filters( 'is_email_address_unsafe', $is_email_address_unsafe, $user_email ); 397 405 } 398 406 399 407 /**