diff --git a/README.md b/README.md index 673b473..7502e69 100644 --- a/README.md +++ b/README.md @@ -25,13 +25,9 @@ PHP contributed by @txt3rob ```php function is_temp_mail($mail) { $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); - if(strcasecmp($mail_domain, $ko_mail) == 0){ - return true; - } - } - return false; + + //Need to ensure the mail contains an @ to avoid undefined offset + return in_array(explode('@', $mail)[1], $mail_domains_ko); } ```