dhyey35 / php-email-address-validation

Automatically exported from code.google.com/p/php-email-address-validation
0 stars 0 forks source link

Email address with valid TLDs not validating #5

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
It appears that the match checking for all numeric TLD (line 153 in rev 9) 
has a reversed length check. I think it should be "> 0" instead of "<= 0".

Attached is a patch which got things working for me.

Original issue reported on code.google.com by codekai...@gmail.com on 11 Feb 2009 at 6:10

Attachments:

GoogleCodeExporter commented 9 years ago
As "// TLD cannot be only numbers" ,
line 153 should be:

"if (strlen(preg_replace('/[0-9]/', '', $arrDomainPortion[$i])) <= 0) {" 

instead of:

if (strlen(preg_replace('/[^0-9]/', '', $arrDomainPortion[$i])) <= 0) {

The "> 0" patch will validate only number TLD and any TLD containing one or 
more 
numbers.

Original comment by pli...@gmail.com on 13 Feb 2009 at 5:17

Attachments:

GoogleCodeExporter commented 9 years ago
I concur with pliski. Pretty much nothing validates without this change.

Original comment by uckel...@gmail.com on 14 Feb 2009 at 10:56

GoogleCodeExporter commented 9 years ago
What about TLDs with numbers?

Original comment by codekai...@gmail.com on 15 Feb 2009 at 12:28

GoogleCodeExporter commented 9 years ago
Pliski (and others): thankyou. I've added your fix and it does now function 
correctly.

Original comment by addedby...@gmail.com on 15 Feb 2009 at 3:04