Forum: better error messages (Suggested by @anyeor)

This commit is contained in:
slawkens
2023-07-07 14:34:26 +02:00
parent df321154f6
commit 34725e0257
9 changed files with 83 additions and 44 deletions

View File

@@ -1247,6 +1247,14 @@ function escapeHtml($html) {
return htmlentities($html, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8');
}
function displayErrorBoxWithBackButton($errors, $action = null) {
global $twig;
$twig->display('error_box.html.twig', ['errors' => $errors]);
$twig->display('account.back_button.html.twig', [
'action' => $action ?: getLink('')
]);
}
// validator functions
require_once LIBS . 'validator.php';
require_once SYSTEM . 'compat/base.php';