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