E-mail validator problem

In my User model, I have an e-mail field and a user profile page where the user can update details from his/her profile. The validation rule is:


public function rules()

{

	return array(

 		...

array('email', 'email', 'allowName'=>true),

 		...

 );

}

I happen to have users with e-mails that contain a dot in the part before @ (eg. V.Laras@domain.co). Using the validation rule as seen above, the validation fails upon saving the model.

This happened after upgrading to 1.0.11 (up until 1.0.10 it worked fine). Even with or without the allowName property set to true, the validation always fails.

Insights?

Have just tried using gaz.bond@gaz.com using Yii 1.1rc.r1585 with no problem.

Hope this helps.

Not really. I’m using the 1.0 branch and want to stick with that before upgrading to 1.1 (when it’s released as stable).

It’s not the dot that is causing your email address to fail validation, it’s the capital letter(s).

In CEmailValidator (1.0.x branch) the validation RegEx pattern used is attributed to http://www.regular-expressions.info/email.html.

In this page, it says: “you will need to turn on the case insensitive matching option.” – which wasn’t done in Yii 1.0.11 :frowning:

Dev team, please can we have this implemented to switch on case INsensitive matching in the email validator… thanks :)

Sorry, this bug was introduced in 1.0.11. I have fixed it in SVN.

^ Interesting

I tried my contact form with .museum TLD and it validated

The link you posted above suggests it shouldn’t work…

I’m using 1.0.10

Yes, I figured out that myself later. I reported the bug and Qiang fixed it moments later.