WordPress.org

Support

Support » How-To and Troubleshooting » Posting from email addresses with “hyphen” cannot be assigned to the user

Posting from email addresses with “hyphen” cannot be assigned to the user

  • 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

Viewing 5 replies - 1 through 5 (of 5 total)
  • What version of WordPress are you using?

    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.

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

    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

    This has been fixed in WordPress 2.3.1

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Posting from email addresses with “hyphen” cannot be assigned to the user’ is closed to new replies.