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.
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
confirmed.
The "+" sign is allowed in Emai, but You can't registrer in XOOPS 2.3.3 with that.
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;
}
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;
}
Fixed in SVN and waiting for review