The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Email Validation in vB5
Hello,
i'm new to vBulletin and i've been wondering about their method of email validation. A client has been reporting "invalid email adress" errors when he wanted to update his profile, so i have been checking on this. Problem was vB was checking casesensitive allowing only lowercase adresses. I found nothing, but a questionable javascript validation. Meaning i basically can input whatever i want. (When making use of some js debugging). Is it right, that there is no server side validation of email input? Also, who does a regular expression for emails like this? :down: Code:
/^[a-z0-9_\-]+(\.[_a-z0-9\-]+)*@([_a-z0-9\-]+\.)+([a-z]{2}|aero|arpa|biz|com|coop|edu|gov|info|int|jobs|mil|museum|name|nato|net|org|pro|travel)$/ |
#2
|
|||
|
|||
That is a perfectly correct and commonly used regular expression for checking email addresses. The only problem with it is that any top level domain can be entered. This is common practice so the programmers don't need to change the code every time a new TLD is created.
I haven't looked at the code, but in vB4 I do believe the email address entered is converted to lower case in the code and then checked. So I would imagine they do the same thing in vB5. I personally can't seem to duplicate the problem unless I actually enter an invalid email address. |
Благодарность от: | ||
Ben.Smith |
#3
|
|||
|
|||
Thanks for the reply.
True, just never saw anyone putting in three-letter TLDs hardcoded in the regex. About the lower case, thats not happening in vb5 :-( I added a conversion to lowercase in the test call of the expression and now it works. |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|