PHP Classes

Bug in Email Validation

Recommend this page to a friend!

      PHP Forms Class with HTML Generator and JavaScript Validation  >  PHP Forms Class with HTML Generator and JavaScript Validation package blog  >  Upcoming Visual HTML ...  >  All threads  >  Bug in Email Validation  >  (Un) Subscribe thread alerts  
Subject:Bug in Email Validation
Summary:In the clientside email validation, umlaut domains do not work.
Messages:4
Author:Tim Kersten
Date:2006-04-02 22:41:03
Update:2006-04-03 01:59:25
 

  1. Bug in Email Validation   Reply   Report abuse  
Picture of Tim Kersten Tim Kersten - 2006-04-02 22:41:03
Hi Manuel,

Just wanted to let you know email validation won't accept umlaut domains.
For example if I had an email address at:

grün.de/

test@grün.de

will not work.

The letters "ü", "ä" and "ö;" are allowed in domains (since about 2 years I think).

By the way, your class really rocks!

Regards,
Tim

  2. Re: Bug in Email Validation   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2006-04-02 23:26:06 - In reply to message 1 from Tim Kersten
I know that the default e-mail validation regular expression does not accept non-ASCII characters.

The problem is more complicated than it seems.

There are other less common character sequences that are not accepted by the regular expression. The problem is that the regular expression to accept all possibly valid character sequences would be extremely long and complicated.

Instead of using a complicated regular expression, the class lets you override the default regular expression so it can accept uncommon character sequences if you really need them.

So, all you need to do is change the email_regular_expression class variable with a regular expression that accepts your language characters.

  3. Re: Bug in Email Validation   Reply   Report abuse  
Picture of Tim Kersten Tim Kersten - 2006-04-02 23:57:45 - In reply to message 2 from Manuel Lemos
Ah ok. Good to know about being able to override it.
I know that they do get long and complex, but would it not be worth it? I wrote one before - and it did take the best part of 3 or 4 hours to do.
Still, would be nice to have one of the few email validators that actually work propery though.

Thanks for the quick reply about overriding it. ;)

Regards,
Tim

  4. Re: Bug in Email Validation   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2006-04-03 01:59:25 - In reply to message 3 from Tim Kersten
I need to study the subject.

It would not be hard to figure a regular expression that supports accent characters of ISO Latin 1. That would work for you.

The problem is that some developers use this class with non ISO-Latin 1 forms. I am particularly concerned with those that use Unicode (UTF-X).