在我将电子邮件插入数据库之前 - >我验证地址
if (filter_var($emailAdress, FILTER_VALIDATE_EMAIL))
{
....
}
..但这可能是一个安全漏洞吗?
$userAccObj = $db->user->findOne( array('email' => array('$regex' => '^'.$emailAdress.'$', '$options' => 'i') ));
我应该这样做吗?还是没有必要?
$emailAdress= preg_replace("/\@/", '\@', $emailAdress);
$emailAdress= preg_replace("/\-/", '\-', $emailAdress);
$emailAdress= preg_replace("/\./", '\.', $emailAdress);