Email Validation Bug

25 views
Skip to first unread message

Eric Lamb

unread,
Aug 29, 2010, 4:12:36 PM8/29/10
to MailPress
Hello,

I found a bug with the email validation javascript in the mail post
form.

The issue is that the email validation was returning false even when
an email was valid, specifically if the email wasn’t entirely
lowercase. The problem with that, in case it’s not clear, is that an
email address doesn’t have to be lower case (at least in the name
portion). For example the below two emails are valid and, in fact,
different:

er...@example.com
Er...@example.com

They look similar and it’s not really advisable to do email addresses
in that format but people do it that way and, technically, it is
allowed so not sure why Mailpress doesn’t.

Mailpress would throw an error on the second email which was pissing
of my client’s client and my client (sigh…). The fix is pretty
straightforward and easy; just replace the regular expression in
Mailpress with the working one I cribbed from
http://www.zparacha.com/validate-email-address-using-javascript-regular-expression/.

File: "/wp-content/plugins/mailpress/mp-admin/js/write.js"
Line: 219
--existing start--
is_email : function(m) { var pattern = /^[_a-z0-9-]+(\.[_a-z0-9-]
+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$/; return
pattern.test(m); },
--existing stop--

Replace the above with:
--working start--
is_email : function(m) { var pattern = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+
\.[a-zA-Z]{2,4}$/; return pattern.test(m); },
--working stop--

Hope that helps anyone :)

Eric

Eric Lamb

unread,
Sep 3, 2010, 6:28:55 PM9/3/10
to MailPress
Well, this is just a shame; I take the time to fix a bug and submit
the solution and there is NOTHING from the developers?!?!? Not even an
acknowledgment that they're looking into it.

Lame.

On Aug 29, 1:12 pm, Eric Lamb <e...@ericlamb.net> wrote:
> Hello,
>
> I found a bug with theemailvalidationjavascript in the mail post
> form.
>
> The issue is that theemailvalidationwas returning false even when
> anemailwas valid, specifically if theemailwasn’t entirely
> lowercase. The problem with that, in case it’s not clear, is that anemailaddress doesn’t have to be lower case (at least in the name
> portion). For example the below two emails are valid and, in fact,
> different:
>
> e...@example.com
> E...@example.com
>
> They look similar and it’s not really advisable to doemailaddresses
> in that format but people do it that way and, technically, it is
> allowed so not sure why Mailpress doesn’t.
>
> Mailpress would throw an error on the secondemailwhich was pissing
> of my client’s client and my client (sigh…). The fix is pretty
> straightforward and easy; just replace the regular expression in
> Mailpress with the working one I cribbed fromhttp://www.zparacha.com/validate-email-address-using-javascript-regul....

andré renaut

unread,
Sep 3, 2010, 7:17:17 PM9/3/10
to mail...@googlegroups.com
will look into it !

2010/9/4 Eric Lamb <er...@ericlamb.net>
--
=== Please Donate ! https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=andre%2erenaut%40gmail%2ecom&lc=US&item_name=MailPress&item_number=gg&amount=5%2e00&currency_code=EUR&currency_code=EUR&bn=PP%2dDonationsBF%3abtn_donate_SM%2egif%3aNonHostedGuest ===

You received this message because you are subscribed to the Google
Groups "MailPress" group.
To post to this group, send email to mail...@googlegroups.com
To unsubscribe from this group, send email to
mailpress+...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/mailpress?hl=en



--
Pensez à l'environnement avant d'imprimer ce message.
Please, think about the environment before printing this message.

andré renaut

unread,
Sep 4, 2010, 7:58:50 AM9/4/10
to mail...@googlegroups.com
changed in    

is_email : function(m) { var pattern = /^[_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$/; return pattern.test(m); },

for write.js, forms.js and mp_meta_box_post_test.js

currently updating

2010/9/4 andré renaut <andre....@gmail.com>
Reply all
Reply to author
Forward
0 new messages