SourceForge has been redesigned. Learn more.
Close

#431 email addresses with a plus (+) in the user-part fail

User_Authentication
closed
5
2012-10-11
2005-03-19
No

In 1.3.10 (and I believe CVS HEAD)

lib/WikiUserNew.php:2454: Warning[512]: E-Mail
Validation Error: E-Mail address
'chris+wiki@ruvolo.net' is not properly formatted

The email validation code does not like the + in the
user-part of the email address, which is valid
according to RFC822. Changing the function
ValidateMail() to allow the + in the regexp works (note
that the + has to lead the range block):

if

(!eregi("^[+_a-z0-9-]+(.[_a-z0-9-]+)@[a-z0-9-]+(.[a-z0-9-]+)(.[a-z]{2,3})$",
$email)) {

Thanks for PhpWiki.

-Chris

Discussion

  • Joel Uckelman

    Joel Uckelman - 2005-04-01

    Logged In: YES
    user_id=245140

    The suggested regex isn't what you want. E.g., it fails on
    foo.bar+baz@example.com, which is valid.

    I'll take a further look at this this afternoon.

     
  • Joel Uckelman

    Joel Uckelman - 2005-04-01

    RFC822 patch for lib/WikiUserNew.php

     
  • Joel Uckelman

    Joel Uckelman - 2005-04-01

    Logged In: YES
    user_id=245140

    Here's a patch which does the trick. It uses Paul Warren's
    nifty RFC822 address regex, which is the most complex regex
    I've ever seen that is still actually useful.

    Please give this a try, and let me know if it works for you.

     

Log in to post a comment.