vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB5 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=263)
-   -   Email Validation in vB5 (https://vborg.vbsupport.ru/showthread.php?t=298092)

Ben.Smith 05-13-2013 07:22 AM

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? :eek: :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)$/
Does anybody know wheather it's a bug or do they just have another understanding of "valid email"? :rolleyes:

nhawk 05-13-2013 10:06 AM

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 05-13-2013 11:12 AM

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.


All times are GMT. The time now is 11:43 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01520 seconds
  • Memory Usage 1,709KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete