Zen Cart Logo
Forums / Bug Reports / [Done v1.5.0] Two .. in email address [email protected] bad errors

[Done v1.5.0] Two .. in email address [email protected] bad errors

Views: 3,291

Results 1 to 4 of 4
25 Jan 2011, 2:43 AM
#1
shrimp_gumbo_mmmhhh avatar

shrimp_gumbo_mmmhhh

Totally Zenned

Join Date:
Jun 2007
Location:
Texas, USA
Posts:
1,436
Plugin Contributions:
0

[Done v1.5.0] Two .. in email address [email protected] bad errors

If the customer enters a bad email address with two .. then it appears that the order is not going through and they keep placing more orders because of the issue. Should have a check for no .. together because of the issue.

26 Jan 2011, 9:58 AM
#2
dutchy avatar

dutchy

Zen Follower

Join Date:
May 2010
Location:
London
Posts:
324
Plugin Contributions:
0

Re: [Done v1.5.0] Two .. in email address [email protected] bad errors

I tried this and I get a white page with a text warning, telling me to look at the email settings in the admin.

Email Error: Could not instantiate mail function. Please check Admin->Configuration->Email Options->Email Transport.

Then backpage and the account is created and the account can make orders etc.

Though I dont think is zen cart specific, as I created a few test accounts with non zen cart store. Some spotted the error, most did not.

27 Jan 2011, 3:58 AM
#3
davewest avatar

davewest

Totally Zenned

Join Date:
Dec 2007
Location:
Payson, AZ
Posts:
1,075
Plugin Contributions:
7

Re: [Done v1.5.0] Two .. in email address [email protected] bad errors

I got the same error... the account gets created, but the email fails to send. Looking at the pattern, I'm not that good with patterns.... drives me nuts looking at them... this is what I found...

includes\functions\functions_email.php

//$valid_email_pattern = '^[a-z0-9]+[a-z0-9_\.\'\-]*@[a-z0-9]+[a-z0-9\.\-]*\.(([a-z]{2,6})|([0-9]{1,3}))$';
    $valid_email_pattern = '^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$';
```Ran the first pattern through a simple email form it would pass the .. without any problems, with the second pattern it would fail if the .. was anywhere together in the address, single dots no problem...  I'm guessing escaping the dot is including it in the pattern check under (\.[a-z]{2,3})
24 Feb 2011, 8:47 AM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
177

Re: [Done v1.5.0] Two .. in email address [email protected] bad errors

Here's the fix:

    $valid_email_pattern =[B] '^([\w\!\#$\%\&\'\*\+\-\/\=\?\^\`{\|\}\~]+\.)*[\w\!\#$\%\&\'\*\+\-\/\=\?\^\`{\|\}\~]+@((((([a-z0-9]{1}[a-z0-9\-]{0,62}[a-z0-9]{1})|[a-z])\.)+[a-z]{2,6})|(\d{1,3}\.){3}\d{1,3}(\:\d{1,5})?)$';[/B]

and later in the file, add the RETURN FALSE; as shown:```
function rfc_validate_email($address)
{[B]
return FALSE;
[/B]
$rfcValidEmailPattern = '.......