Quote:
Originally Posted by kh99
That's a good thought, but unfortunately it won't work the way this is written. It replaces the code that verifies an email address, so if you have multiple plugins doing the same thing, only the last one to run would have any effect.
You might be able to do something like this:
|
Perfect.
Slight modification to prevent commas, semicolons, and colons, since I got another Chinese bot this morning trying to register with the email "liantianha,ofangjiancong@gmail.com":
PHP Code:
$this->validfields['email'][VF_CODE] = '
$max_chars = array("." => 1, "," => 0, ";" => 0, ":" => 0);
if ($retval = $dm->verify_useremail($data))
{
$parts = explode("@", $data);
if (is_array($parts))
{
foreach($max_chars AS $char => $max)
{
if (substr_count($parts[0], $char) > $max)
{
$dm->error("bademail");
$retval = false;
break;
}
}
}
}
return $retval;
';