Fix crash on empty form submit
This commit is contained in:
parent
56526cb8ce
commit
761732cd1b
@ -11,8 +11,8 @@ require_once __DIR__ . "/../../lib/requiredpublic.php";
|
||||
require_once __DIR__ . "/../../lib/Email.lib.php";
|
||||
|
||||
function errorBack(string $errormsg) {
|
||||
global $familyid;
|
||||
//header("Location: ../?page=signup&error=" . htmlentities($errormsg));
|
||||
global $familyid, $database;
|
||||
header("Location: ../?page=signup&error=" . htmlentities($errormsg));
|
||||
$database->delete("families", ["familyid" => $familyid]);
|
||||
die($errormsg);
|
||||
}
|
||||
@ -31,6 +31,10 @@ $database->action(function($database) {
|
||||
|
||||
$emails = [];
|
||||
|
||||
if (!isset($_POST["people"]) || empty($_POST["people"])) {
|
||||
errorBack("You need to register at least one person.");
|
||||
}
|
||||
|
||||
try {
|
||||
|
||||
$people = $_POST['people'];
|
||||
|
Loading…
x
Reference in New Issue
Block a user