Post by vimal » Wed Jan 06, 2010 9:01 pm

Hi All,

One of my customers has an email address similar to bebe_musrabston_@hotmail.com (I have changes the alphabets) but it doesn't accept the email address when she tries to register on the website. I have tried myself and it doesn't accept.

Is there some check on email addresses that doesn't allow something from this email?

Open cart version 1.3.2.

Thanks!
Vimal.

www.beeshop.se
Starta webbshop, Starta e-butik, Starta e-handel


Active Member

Posts

Joined
Wed Aug 26, 2009 8:54 am
Location - Sweden

Post by Qphoria » Wed Jan 06, 2010 10:40 pm

I know that some emails that have multiple dots in the domain don't seem to work in some cases.
like

Code: Select all

bob@my.web.co.uk
I think the email validation regex might need to be improved.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by vimal » Wed Jan 06, 2010 11:21 pm

Hi Q, is there any temporary fix? Something I could go and change?

www.beeshop.se
Starta webbshop, Starta e-butik, Starta e-handel


Active Member

Posts

Joined
Wed Aug 26, 2009 8:54 am
Location - Sweden

Post by Qphoria » Wed Jan 06, 2010 11:38 pm

Try this:

1. EDIT: catalog/controller/account/create.php

2. FIND:

Code: Select all

$pattern = '/^([a-z0-9])(([-a-z0-9._])*([a-z0-9]))*\@([a-z0-9])(([a-z0-9-])*([a-z0-9]))+(\.([a-z0-9])([-a-z0-9_-])?([a-z0-9])+)+$/i';
3. CHANGE TO:

Code: Select all

$pattern = '/[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?/i';
reference (http://www.regular-expressions.info/email.html)

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by vimal » Thu Jan 07, 2010 12:32 am

Hi Q! Thanks for your help. The code you provided didnät work but the reference site was excellent.

Just so others could benefit... I changed my code by adding an additional ([-a-z0-9._]) before the *\@

Code: Select all

$pattern = '/^([a-z0-9])(([-a-z0-9._])*([a-z0-9]))([-a-z0-9._])*\@([a-z0-9])(([a-z0-9-])*([a-z0-9]))+(\.([a-z0-9])([-a-z0-9_-])?([a-z0-9])+)+$/i';
Allowing my email address break down as below

bebe = ([a-z0-9])
_musrabston = (([-a-z0-9._])*([a-z0-9]))
_ = ([-a-z0-9._])
@hotmail.com = *\@([a-z0-9])(([a-z0-9-])*([a-z0-9]))+(\.([a-z0-9])([-a-z0-9_-])?([a-z0-9])+)+$/i';

Now it accepts the email address. :)

www.beeshop.se
Starta webbshop, Starta e-butik, Starta e-handel


Active Member

Posts

Joined
Wed Aug 26, 2009 8:54 am
Location - Sweden

Post by jaden » Thu Jan 14, 2010 10:11 pm

Hi,

I'm having issue with regular expression.

What would the pattern be for this - firstname.lastname@domain.com.au

Newbie

Posts

Joined
Thu Dec 17, 2009 10:49 pm

Post by jaden » Thu Jan 14, 2010 11:10 pm

nvm, I worked it out

Newbie

Posts

Joined
Thu Dec 17, 2009 10:49 pm
Who is online

Users browsing this forum: No registered users and 37 guests