Ban domain extentions buddypress
<p>can someone please help me out, I am using Buddypress/wordpress and i want to ban some domain extensions e.g .pl, .ru, .asia. i have tried the following functions which works for email domain but not extensions.</p>

<pre><code>function my_bp_ban_domains( $result ) {
    $banned = array('.ru', '.pl');
    $error = 'God catch you brah !!!, Spammers are not welcome here, try your luck elsewhere.';
    $email = $result['user_email']; 
    $domain = array_pop(explode('@', $email));
    if ( in_array($domain, $banned)) {
        $result['errors']-&gt;add('user_email', __($error, 'my_bp_ban_domains' ) );
    };
    return $result;
}

add_filter( 'bp_core_validate_user_signup', 'my_bp_ban_domains' );
</code></pre>

<p>Thanks</p>
