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

@@ -191,12 +191,13 @@ if(!$logged)
}
if(!ctype_alnum(str_replace(array('-', '_'), '', $action))) {
error('Error: Action contains illegal characters.');
$errors[] = 'Error: Action contains illegal characters.';
displayErrorBoxWithBackButton($errors, getLink('forum'));
}
else if(file_exists(PAGES . 'forum/' . $action . '.php')) {
require PAGES . 'forum/' . $action . '.php';
}
else {
error('This page does not exists.');
$errors[] = 'This page does not exists.';
displayErrorBoxWithBackButton($errors, getLink('forum'));
}
?>