Bug #66681 [Fbk->NoF]: filter_var($email,FILTER_VALIDATE_EMAIL) error

From: Date: Tue, 30 Dec 2014 10:42:26 +0000
Subject: Bug #66681 [Fbk->NoF]: filter_var($email,FILTER_VALIDATE_EMAIL) error
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-189464@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=66681&edit=1 ID: 66681 Updated by: php-bugs@lists.php.net Reported by: dan at bigbirdmedia dot com Summary: filter_var($email,FILTER_VALIDATE_EMAIL) error -Status: Feedback +Status: No Feedback Type: Bug Package: Filter related Operating System: Apache/Linux PHP Version: Irrelevant Private report: N New Comment: No feedback was provided. The bug is being suspended because we assume that you are no longer experiencing the problem. If this is not the case and you are able to provide the information that was requested earlier, please do so and change the status of the bug back to "Re-Opened". Thank you. Previous Comments: ------------------------------------------------------------------------ [2014-02-10 05:24:13] requinix@php.net Works for me. Your function returns false if the filter_var check fails or the checkdnsrr check fails. You need to figure out which is happening. And the PHP version is not irrelevant. What are you using? ------------------------------------------------------------------------ [2014-02-10 05:16:22] dan at bigbirdmedia dot com Description: ------------ --- From manual page: http://www.php.net/filter.examples.validation --- It seems that the filter_var() function doesn't quite work for all emails, at least not consistently. Test script: --------------- <?php function domainExists($email) { if(filter_var($email,FILTER_VALIDATE_EMAIL)) { list($user, $domain) = explode('@', $email); if(checkdnsrr($domain, 'MX')) { return TRUE; } else { return FALSE; } } else { return FALSE; } } $rm = 'jane_doe@hotmail.com'; if(domainExists($rm) === TRUE) { echo '<p>It worked!</p>'; } else { echo '<p>It didn\'t work!</p>'; } ?> Expected result: ---------------- I expect the function in the test/sample script to return true and echo '<p>It worked!</p>'. Actual result: -------------- The actual result is '<p>It didn\'t work!</p>'. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=66681&edit=1

« previous php.bugs (#189464) next »