修正电子邮箱过滤不严可能造成的xss

This commit is contained in:
祁宁 2014-03-12 11:29:54 +08:00
parent 90e2c08542
commit f7cb1a1d49

View File

@ -209,7 +209,7 @@ class Typecho_Validate
*/
public function email($str)
{
return preg_match("/^[^@\s<&>]+@([-a-z0-9]+\.)+[a-z]{2,}$/i", $str);
return preg_match("/^[_a-z0-9-\.]+@([-a-z0-9]+\.)+[a-z]{2,}$/i", $str);
}
/**