Skip to content

Commit

Permalink
Make email checks case insensitive. #5440
Browse files Browse the repository at this point in the history
  • Loading branch information
pippinsplugins committed Jun 7, 2017
1 parent 1d8b503 commit 4d8b5ef
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion includes/checkout/functions.php
Expand Up @@ -269,6 +269,7 @@ function edd_is_email_banned( $email = '' ) {
return false;
}

$email = strtolower( $email );
$banned_emails = edd_get_banned_emails();

if( ! is_array( $banned_emails ) || empty( $banned_emails ) ) {
Expand All @@ -277,12 +278,24 @@ function edd_is_email_banned( $email = '' ) {

$return = false;
foreach( $banned_emails as $banned_email ) {

$banned_email = strtolower( $banned_email );

if( is_email( $banned_email ) ) {

// Complete email address
$return = ( $banned_email == $email ? true : false );
} elseif ( strpos( $banned_email, '.' ) === 0 ) { // Domains only

} elseif ( strpos( $banned_email, '.' ) === 0 ) {

// TLD block
$return = ( substr( $email, ( strlen( $banned_email ) * -1 ) ) == $banned_email ) ? true : false;

} else {

// Domain block
$return = ( stristr( $email, $banned_email ) ? true : false );

}

if( true === $return ) {
Expand Down

0 comments on commit 4d8b5ef

Please sign in to comment.