Commit c8cf91523b1d2e648f3e423f583e395819dd45d0
1 parent
180ad529
Exists in
fix_user_email_validation
Fix bug in email validation regex
Signed-off-by: Charles Oliveira <18oliveira.charles@gmail> Signed-off-by: Lucas Moura <lucas.moura128@gmail.com> Signed-off-by: Luciano Prestes Cavalcanti <lucianopcbr@gmail.com>
Showing
2 changed files
with
6 additions
and
2 deletions
Show diff stats
app/views/account/_signup_form.html.erb
... | ... | @@ -135,6 +135,10 @@ |
135 | 135 | |
136 | 136 | <script type="text/javascript"> |
137 | 137 | jQuery(function($) { |
138 | + $.validator.addMethod('validEmail', function(value, element) { | |
139 | + var regex = /^([^\W_])([\w.-]+)@((?:[-_a-z0-9]+\.)+[a-z]{2,})$/i; | |
140 | + return this.optional(element) || regex.test(value); | |
141 | + }, 'Please enter a valid e-mail'); | |
138 | 142 | |
139 | 143 | $('#signup-form input[type=text], #signup-form textarea').each(function() { |
140 | 144 | $(this).bind('blur', function() { | ... | ... |
lib/noosfero/constants.rb