forked from vern/website
Make email check more general
Signed-off-by: Skylar "The Cobra" Widulski <cobra@vern.cc>
This commit is contained in:
parent
94b2a3f5ac
commit
e752fcca82
|
@ -26,17 +26,21 @@
|
|||
return $str;
|
||||
}
|
||||
$err = $email = $code_err = '';
|
||||
if (!empty($_GET['email'])) {
|
||||
if (!empty($_GET['email']) && !empty($_GET['action'])) {
|
||||
if (filter_var(sanitize($_GET['email']), FILTER_VALIDATE_EMAIL)) {
|
||||
if (preg_match("/^" . preg_quote($_GET['email']) . "$/", file_get_contents("/var/spool/list")) === 1) {
|
||||
$email = sanitize($_GET['email']);
|
||||
if ($_GET['action'] == "sub")
|
||||
$email = sanitize($_GET['email']);
|
||||
else $err = "E-mail not in list";
|
||||
} else {
|
||||
$err = "E-mail already in use";
|
||||
if ($_GET['action'] == "unsub")
|
||||
$email = sanitize($_GET['email']);
|
||||
else $err = "E-mail already in list";
|
||||
}
|
||||
} else {
|
||||
$err = "Invalid E-mail";
|
||||
}
|
||||
} else if (!empty($_GET['action'])) {
|
||||
} else {
|
||||
$err = "E-mail is required";
|
||||
}
|
||||
if (empty($_GET['action']) || ($_GET['action'] != "sub" && $_GET['action'] != "unsub") || !empty($err)) {
|
||||
|
|
Loading…
Reference in New Issue