Menu

#842 does not accept some valid email addresses

XOOPS_2.5.x
closed
trabis
5
2012-09-25
2008-06-08
Anonymous
No

Upon trying to register some email address, for example, an email address containing the plus symbol, xoops reports that the email address is invalid. According to SMTP RFCs plus symbols, along with others, are valid.

Discussion

  • R E Broadley

    R E Broadley - 2008-06-08

    Logged In: YES
    user_id=1254951
    Originator: NO

    Can confirm this problem exists. See http://www.uk-poly.net/register.php as an example where plus symbol is not accepted. Unsure of version of XOOPS however.

     
  • anderssk

    anderssk - 2009-04-13

    confirmed.
    The "+" sign is allowed in Emai, but You can't registrer in XOOPS 2.3.3 with that.

     
  • anderssk

    anderssk - 2009-08-06

    old code from include/functions.php

    function checkEmail($email, $antispam = false)
    {
    if (!$email || !preg_match("/^[_a-z0-9-]+(.[_a-z0-9-]+)*@[a-z0-9-]+([.][a-z0-9-]+)+$/i", $email)){
    return false;
    }
    if ($antispam) {
    $email = str_replace("@", " at ", $email);
    $email = str_replace(".", " dot ", $email);
    }
    return $email;
    }

     
  • anderssk

    anderssk - 2009-08-06

    Surgestion for replacementcode
    Also checks that there no more that 64 characters before @-sign and no more than 255 after.

    function checkEmail($email, $antispam = false)
    {
    if (!ereg("^[^@]{1,64}@[^@]{1,255}$", $email)) {
    }
    $email_array = explode("@", $email);
    $local_array = explode(".", $email_array[0]);
    for ($i = 0; $i < sizeof($local_array); $i++) {
    if
    (!ereg("^(([A-Za-z0-9!#$%&'*+/=?^_{|}~-][A-Za-z0-9!#$%& ↪'*+/=?^_{|}~.-]{0,63})|(\"[^(\|\")]{0,62}\"))$",
    $local_array[$i])) {
    return false;
    }
    }
    if (!ereg("^[?[0-9.]+]?$", $email_array[1])) {
    $domain_array = explode(".", $email_array[1]);
    if (sizeof($domain_array) < 2) {
    return false; // Not enough parts to domain
    }
    for ($i = 0; $i < sizeof($domain_array); $i++) {
    if
    (!ereg("^(([A-Za-z0-9][A-Za-z0-9-]{0,61}[A-Za-z0-9])|
    ↪([A-Za-z0-9]+))$",
    $domain_array[$i])) {
    return false;
    }
    }
    }
    if ($antispam) {
    $email = str_replace("@", " at ", $email);
    $email = str_replace(".", " dot ", $email);
    }
    return $email;
    }

     
  • trabis

    trabis - 2011-09-16

    Fixed in SVN and waiting for review

     

Log in to post a comment.