Gmail email addresses with "+" symbol are being rejected as "You entered an invalid email address."

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • trippy1976
    New Member
    • Oct 2007
    • 8

    Gmail email addresses with "+" symbol are being rejected as "You entered an invalid email address."

    I'm loading user details from my main website to my 4.2.1 version forums software via a CURL script command.

    In the receiving script I do the following:
    $userdm->set('email', qpc_post('email'));

    Then later I check if there were errors:
    if (count($userdm->errors)) {
    for($i=0; $i<count($userdm->errors); $i++) {
    print "ERROR{$i}:{$userdm->errors[$i]}\n";
    }
    } else {
    # If everything is OK
    $newuserid = $userdm->save();
    print "$newuserid\n";
    }

    If not, I save the user information. This has been working fine for years.

    Now, a number of my users are using gmail addresses with + symbol in them.

    As an example they can add a + and then anything to a gmail. This allows them to see where the email is coming from potentially. I actually use this option myself.

    [email protected]

    Anything with that + symbol gets rejected as "You entered an invalid email address."

    Can I somehow change a setting to allow + in the email?
  • worried
    Senior Member
    • Dec 2008
    • 684
    • 4.2.X

    #2
    Just my opinion. I would consider using reserved characters bad practice for username.

    Comment

    • BirdOPrey5
      Senior Member
      • Jul 2008
      • 9613
      • 5.6.3

      #3
      Originally posted by worried
      Just my opinion. I would consider using reserved characters bad practice for username.
      He's saying the problem is with the email not the username.

      This is weird because there is a bug that was fixed in 4.2.1 - http://tracker.vbulletin.com/browse/VBIV-15206

      And the regex that checks for a valid email clearly DOES allow there to be a + in the email address-

      Code:
      ^[a-z0-9.!\#$%&\'*+\-/=?^_`{|}~]+@([0-9.]+|([^\s\'"<>@,;]+\.+[a-z]{2,6}))$
      Do you have any 3rd party plugins that could be checking emails?

      Comment

      • Zachery
        Former vBulletin Support
        • Jul 2002
        • 59097

        #4
        Since you're writing custom code, this should really be handled at vBulletin.org

        Comment

        widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
        Working...