Refactor code, better $error messages

This commit is contained in:
slawkens
2025-09-14 20:49:14 +02:00
parent 849944ff20
commit 05b5e703ed
9 changed files with 180 additions and 102 deletions

View File

@@ -14,11 +14,17 @@ if($account->isLoaded()) {
]);
}
else {
echo 'Account of this character has no recovery key!';
$errors[] = 'Account of this character has no recovery key!';
}
}
else {
echo "Player or account of player <b>" . escapeHtml($nick) . "</b> doesn't exist.";
$errors[] = "Player or account of player <b>" . escapeHtml($nick) . "</b> doesn't exist.";
}
if (!empty($errors)) {
$twig->display('error_box.html.twig', [
'errors' => $errors,
]);
}
$twig->display('account.back_button.html.twig', [