Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 0.8.5

Bug #8629 eMail validation fails
Submitted: 2006-09-04 05:31 UTC Modified: 2006-12-16 06:16 UTC
From: g dot schuster at laxit dot com Assigned: amir
Status: Closed Package: Validate (version 0.6.4)
PHP Version: Irrelevant OS: irrelevant
Roadmaps: 0.8.0    
Subscription  


 [2006-09-04 05:31 UTC] g dot schuster at laxit dot com (G. Schuster)
Description: ------------ eMail validation in package Validate, function email() fails with numbers at start of hostname. Test script: --------------- $result = email('test@123host.tld'); Expected result: ---------------- Should return TRUE due to valid email address provided in the example Actual result: -------------- Returns FALSE due to false regular expression. Original regular expression: ((?:[a-z0-9](?:[-a-z0-9]*[a-z0-9])?\.)*[a-z](?:[-a-z0-9]*[a-z0-9])?) #6 domain as hostname Working regular expression: ((?:[a-z0-9](?:[-a-z0-9]*[a-z0-9])?\.)*[a-z0-9](?:[-a-z0-9]*[a-z0-9])?) #6 domain as hostname

Comments

 [2006-09-04 11:25 UTC] amir at php dot net (Amir Mohammad Saied)
Use 'rfc822 restricted' mode.
 [2006-09-05 03:14 UTC] g dot schuster at laxit dot com
Sorry, that's a workaround, no solution. Even the simple email() function should recognize absolutely correct formed email addresses and hostnames. I think this should be fixed in the next release of Validate.
 [2006-09-20 12:48 UTC] amir at php dot net (Amir Mohammad Saied)
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better. Hostnames starting with numbers are known valid now.
 [2006-09-21 02:42 UTC] g dot schuster at laxit dot com
Thank you so far :)