Skip to content

Commit

Permalink
Loosen the email regex a lot.
Browse files Browse the repository at this point in the history
See comments on #9.
  • Loading branch information
michaeltwofish committed Nov 27, 2011
1 parent 7002be7 commit b717ce4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions installer/script.js
Expand Up @@ -96,10 +96,10 @@ var installer = {
}
});

// Check if email is valid
var regexemail = /[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+(?:[A-Z]{2}|com|org|net|edu|gov|mil|biz|info|mobi|name|aero|asia|jobs|museum)\b/ // Original from http://www.regular-expressions.info/email.html
if ( regexemail.test( $("#adminemail").val() ) ) {
$("#adminemail").parents(".inputfield").removeClass('invalid').addClass('valid').find('.warning:visible').fadeOut();
// Very loosely check if the email is valid (don't be tempted to check this more strictly, you'll go mad, annoy people, or both).
var regexemail = /.+@.+/;
if (regexemail.test($('#adminemail').val())) {
$('#adminemail').parents('.inputfield').removeClass('invalid').addClass('valid').find('.warning:visible').fadeOut();
}
else {
$("#adminemail").parents('.inputfield').removeClass('valid').addClass('invalid');
Expand Down

0 comments on commit b717ce4

Please sign in to comment.