mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-24 20:17:24 +08:00
validate email with filter_var
This commit is contained in:
@@ -2316,7 +2316,7 @@ function validfilename($name) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function validemail($email) {
|
function validemail($email) {
|
||||||
return preg_match('/^[\w.-]+@([\w.-]+\.)+[a-z]{2,6}$/is', $email);
|
return filter_var($email, FILTER_VALIDATE_EMAIL) !== false;
|
||||||
}
|
}
|
||||||
|
|
||||||
function validlang($langid) {
|
function validlang($langid) {
|
||||||
|
|||||||
@@ -311,7 +311,7 @@ if (count($_GET) > 0 && !$_GET['h'])
|
|||||||
if (strpos($email,'*') === False && strpos($email,'?') === False
|
if (strpos($email,'*') === False && strpos($email,'?') === False
|
||||||
&& strpos($email,'%') === False)
|
&& strpos($email,'%') === False)
|
||||||
{
|
{
|
||||||
if (validemail($email) !== 1)
|
if (!validemail($email))
|
||||||
{
|
{
|
||||||
stdmsg("Error", "Bad email.");
|
stdmsg("Error", "Bad email.");
|
||||||
stdfoot();
|
stdfoot();
|
||||||
|
|||||||
Reference in New Issue
Block a user