|
[F] Extra @ in valid email [R] [C-Chris]
|
|
02-12-2009, 06:32 PM
Post: #1
|
|||
|
|||
|
[F] Extra @ in valid email [R] [C-Chris]
MyBB doesn't accept 2 @ chars in an email, as it should. However, the AJAX check, marks it as valid (in other words, having two @ chars in an email marks the field green).
I tried an invalid email like so: fdf@dfd@yahoo.com And it highlighted the email field green. However, having an email like so: goooggglglg@@google.com is invalid. It's nothing major, but it pretty much defeats the purpose of the AJAX check validation for easy registration. Best Regards. Hire Me Clicktotweet.me |
|||
|
02-12-2009, 08:42 PM
(This post was last modified: 02-12-2009 09:00 PM by dvb.)
Post: #2
|
|||
|
|||
|
RE: Extra @ in valid email
The regexp seems to be ok...
Code: /^([a-zA-Z0-9_\.\+\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/UPDATE: Strange.... I'm not so good in js, so maybe someone else will be able to explain this: open the firebug console and copy&paste the following: Code: regex1 = /^([a-zA-Z0-9_\.\+\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;Quote:1: falseAlthough, the regexes are the same. Of course as you can understand MyBB using the second method ("new RegExp") Creativity is a drug I cannot live without. |
|||
|
02-12-2009, 09:30 PM
Post: #3
|
|||
|
|||
|
RE: Extra @ in valid email [R]
Shouldn't this:
Code: /^([a-zA-Z0-9_\.\+\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/Be this: Code: /!^([a-zA-Z0-9_\.\+\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$!/That will make it strict and it should work. Hire Me Clicktotweet.me |
|||
|
02-12-2009, 09:50 PM
(This post was last modified: 02-12-2009 10:17 PM by dvb.)
Post: #4
|
|||
|
|||
|
RE: Extra @ in valid email [R]
oh... it has nothing to do with the regexes, nor nothing special to javascript... it's the slashes!
in the first method ( /theregex/ ), the slashes are part of the regex, they're used to escape literal chars into the regex BUT in the second method ( new RegExp('theregex') ), the slashes between the apostrophes are used to escape special chars into the string like '\r\n\t' THE SOLUTION: while using the second method every slash should be doubled so the first one used to escape the second into the string and the second slash will escape the literal char into the regex In the ACP open the template 'member_register', scroll down and find the following line: Code: regValidator.register('email', 'regexp', {match_field:'email2', regexp:'^([a-zA-Z0-9_\.\+\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$', failure_message:'{$lang->js_validator_invalid_email}'});Code: regValidator.register('email', 'regexp', {match_field:'email2', regexp:'^([a-zA-Z0-9_\\.\\+\\-])+\\@(([a-zA-Z0-9\\-])+\\.)+([a-zA-Z0-9]{2,4})+$', failure_message:'{$lang->js_validator_invalid_email}'});Can someone just validate this again? Also someone should search any other place in MyBB that this problem might occur again Creativity is a drug I cannot live without. |
|||
|
02-13-2009, 12:30 AM
Post: #5
|
|||
|
|||
|
[F] Extra @ in valid email [R]
Thank you for your bug report.
This bug has been fixed in our internal code repository. Please note that the problem will not be fixed here until these forums are updated. With regards, MyBB Group Creativity is a drug I cannot live without. |
|||
|
02-28-2009, 08:20 PM
(This post was last modified: 02-28-2009 08:20 PM by Imad Jomaa.)
Post: #6
|
|||
|
|||
|
RE: [F] Extra @ in valid email [R]
Solution is confirmed to work. All what's left is to have a developer update the revision, then I'll confirm the thread.
Hire Me Clicktotweet.me |
|||
|
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)
Search
Member List
Calendar
Help

