WordPress.org

Ready to get started?Download WordPress

Forums

Posting from email addresses with "hyphen" cannot be assigned to the user (6 posts)

  1. giannis1
    Member
    Posted 6 years ago #

    I am trying to post a message via email and HTML form to my WordPress... and it doesn't assign the post to the user when the email address includes "hyphen"...when user's email address is without "hyphen" is assign perfectly the post to the User.

    For example:

    When a user@testing.com submit a post via an external HTML form or by email, the post is assigned to the user. However, when user@test-ing.com submit, it assigns the post to the admin.

    Please help!

    Thanks

    John

  2. Bobcat
    Member
    Posted 6 years ago #

    What version of WordPress are you using?

  3. Bobcat
    Member
    Posted 6 years ago #

    OK, I found the problem in WordPress version 2.3. A regular expression looking for an email address is wrong. Give this a try:

    In wp-mail.php, line 67, change:

    if ( ereg("([a-zA-Z0-9\_\-\.]+@[\a-zA-z0-9\_\-\.]+)", $author , $regs) ) {

    to:

    if ( ereg("([-a-zA-Z0-9_.]+@[-a-zA-Z0-9_.]+)", $author , $regs) ) {

    Please let me know if this solves your problem.

  4. giannis1
    Member
    Posted 6 years ago #

    It's fixed! Thank you VERY VERY much Bobcat! You're the man! :))

  5. Bobcat
    Member
    Posted 6 years ago #

    OK, great! I'm going to add this to a patch I'm developing for wp-mail to make sure a user has the 'publish_posts' capability before publishing a post received via email. It will be a day or two before I add this ereg fix to the patch. See: http://trac.wordpress.org/ticket/4642

  6. Bobcat
    Member
    Posted 6 years ago #

    This has been fixed in WordPress 2.3.1

Topic Closed

This topic has been closed to new replies.

About this Topic