I'd like to block all *.info email addresses from registering. That should be possible by hacking this function in wpmu-functions.php:
function is_email_address_unsafe( $user_email ) {
$banned_names = get_site_option( "banned_email_domains" );
if ( is_array( $banned_names ) && empty( $banned_names ) == false ) {
$email_domain = strtolower( substr( $user_email, 1 + strpos( $user_email, '@' ) ) );
foreach( (array) $banned_names as $banned_domain ) {
if( $banned_domain == '' )
continue;
if (
strstr( $email_domain, $banned_domain ) ||
(
strstr( $banned_domain, '/' ) &&
preg_match( $banned_domain, $email_domain )
)
)
return true;
}
}
return false;
}
According to this instruction it's easy:
Look at is_email_address_unsafe() in wpmu- functions.php - there's a preg_match() there if you have a regex in the list of domains enclosed in "/" characters. For example, /.*\.info/ will match *.info
But I can't put it together. What am I supposed to put where? Like this?:
strstr( $banned_domain, '/.*\.info/' )
What if I want to ban a whole list of domains?
Apparently the Banned Email List in wpmu admin options does not work because of a bug. Has that been fixed in latest versions? Will it be?