do not send empty messages
This commit is contained in:
parent
9ad5116d3c
commit
66dd6d9df3
|
@ -8,7 +8,7 @@ define('LARGE_LIMIT',131072);
|
||||||
$subject="OpenPGP.js Example";
|
$subject="OpenPGP.js Example";
|
||||||
$to="alex@openpgpjs.org";
|
$to="alex@openpgpjs.org";
|
||||||
$headers = "From: OpenPGP.js Example <noreply@openpgpjs.org>\r\n";
|
$headers = "From: OpenPGP.js Example <noreply@openpgpjs.org>\r\n";
|
||||||
$redirect = "http://openpgpjs.org";
|
$redirect = "http://openpgpjs.org/";
|
||||||
/* -------------------------------------------------------------------------- */
|
/* -------------------------------------------------------------------------- */
|
||||||
|
|
||||||
/* input -------------------------------------------------------------------- */
|
/* input -------------------------------------------------------------------- */
|
||||||
|
@ -20,6 +20,7 @@ $message=substr(trim($_POST["message"]), 0, LARGE_LIMIT);
|
||||||
if (filter_var($user, FILTER_VALIDATE_EMAIL)) {
|
if (filter_var($user, FILTER_VALIDATE_EMAIL)) {
|
||||||
$headers = "From: $user\r\n";
|
$headers = "From: $user\r\n";
|
||||||
}
|
}
|
||||||
|
if (!empty($message))
|
||||||
mail($to, $subject, $message, $headers);
|
mail($to, $subject, $message, $headers);
|
||||||
/* -------------------------------------------------------------------------- */
|
/* -------------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user