Merge pull request #40 from deguif/patch-6

Simplified PHP code again
This commit is contained in:
Martin Cech 2016-06-17 10:44:30 -04:00 committed by GitHub
commit 8fe5a7c279

View File

@ -25,13 +25,9 @@ PHP contributed by @txt3rob
```php ```php
function is_temp_mail($mail) { function is_temp_mail($mail) {
$mail_domains_ko = file('disposable_email_blacklist.conf', FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); $mail_domains_ko = file('disposable_email_blacklist.conf', FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
foreach($mail_domains_ko as $ko_mail) {
list($mail_address, $mail_domain) = explode('@',$mail); //Need to ensure the mail contains an @ to avoid undefined offset
if(strcasecmp($mail_domain, $ko_mail) == 0){ return in_array(explode('@', $mail)[1], $mail_domains_ko);
return true;
}
}
return false;
} }
``` ```