Made of Everything You're Not

Writing code... well, forever really. Sigh...
  • Home
  • Projects
  • Portfolio
  • Resume
« WP-Click-Track 0.7.2 Released
Developing ExpressionEngine 1.6x Extensions »

Mailpress 5.0 Email Validation Bug

A couple weeks ago I received an email from a client of mine about a bug one of their clients was having using the Mailpress WordPress plugin and wanting to know if I could help. They’re an agency and I always want to make them happy so, even though I didn’t write Mailpress, I decided to dive in a see what was up. Plus, it’s always fun to contribute to open source projects and to get paid to do it is always a win-win.

Mailpress Email Validation Bug

Mailpress Email Validation Bug

Before getting into the bug I just want to say that I didn’t want to post it in this way; ideally there would be channels available to submit issues but Mailpress doesn’t exactly make that easy. Their site, while having links to the expected destinations like Community and Submitting a patch, doesn’t appear to be finished and those sections are essentially empty at the moment.  The information to put this information out there very well might be in the site but, frankly, the thought of writing this post was less painful than digging through the site looking for info. Plus, this isn’t a security issue at all so there’s that. Ass == Covered.

The issue was 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:

eric@example.com
Eric@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 stratightford and easy; just replace the regular expression in Mailpress with the working one I cribbed from Zaheer.

File: “/wp-content/plugins/mailpress/mp-admin/js/write.js”

219
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); },

With:

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

Hopefully, the issue doesn’t go deeper than the javascript validation but the above does allow for a working email validation script. Now we just need Mailpress to update their wonderful plugin with the fix…

Bookmark and Share

Related Posts

jQuery HoverIntent
Wp-Click-Track 0.7.1
Half Assed Cron With WP Cron
Introducing WP-hResume
Tablekit: HTML Table Enhancements

Tags: JavaScript, mailpress, wordpress, wordpress plugin

This entry was written by Eric Lamb and posted on Tuesday, August 10th, 2010 at 12:00 am and is filed under Code, Programming, Rant. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

4 Comments

  1. Hilary Albutt says:
    August 29, 2010 at 7:55 am

    You are unfortunately wrong, there is a very active community and the developer answers each and every email very quickly. I agree his web site needs help. However I am not surprised as he is very diligent in answering every email.

    In more than just english, french too afaik. His name is Andre Renaut you can join the google group set upf or this purpose mailpress@googlegroups.com, sign up and I am sure Andre will appreciate your input.

    Reply
    • Eric Lamb says:
      August 29, 2010 at 12:58 pm

      Hi HIlary,

      I think it’s sweet that you’re defending Mailpress on this point; more people should step up like you have.

      I’ll check it.

      Eric

      Reply
      • Hilary Albutt says:
        August 30, 2010 at 11:43 am

        Glad to see you contributing, we all benefit when the true spirit of sharing in the community is awakened.

        Reply
        • Eric Lamb says:
          August 31, 2010 at 12:25 pm

          Hi Hilary,

          You made such a compelling argument that, unfortunately, isn’t backed up by reality. I posted the bug 2 days ago and there hasn’t even been a single response..

          I maintain that mailpress is a ghetto.

          Eric

          Reply

Leave a Reply

Click here to cancel reply.

  • Subscribe: Entries | Comments
  • About Me

    Email Email
    Twitter Twitter
    310.739.3322
  • Categories

    • Brain Dump
    • Business
    • Code
    • IT
    • Programming
    • Rant
    • Servers
  • Archives

    • February 2012
    • October 2011
    • August 2011
    • July 2011
    • June 2011
    • May 2011
    • April 2011
    • March 2011
    • February 2011
    • January 2011
    • December 2010
    • November 2010
    • October 2010
    • September 2010
    • August 2010
    • July 2010
    • June 2010
    • May 2010
    • April 2010
    • March 2010
    • February 2010
    • January 2010
    • December 2009
    • November 2009
    • October 2009
    • September 2009
    • August 2009
    • July 2009
    • June 2009
    • May 2009
    • April 2009
    • March 2009
    • February 2009
    • January 2009
    • December 2008
    • November 2008
    • October 2008

Copyright © 2008 - 2012 Eric Lamb - All rights reserved