Actually enforce the length limitation on the poll creator name

Show a nice error message if it's too long (not on the edit page because
there's no support for this right now)

mbstring is now a required extension

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel 2021-03-22 19:04:44 +01:00
parent a5c7df64b2
commit 36cef8cc39
No known key found for this signature in database
GPG key ID: A061B9DDE0CA0773
6 changed files with 22 additions and 3 deletions

View file

@ -143,7 +143,9 @@ if (isset($_POST['update_poll_info'])) {
$updated = true;
}
} elseif ($field === 'name') {
$admin_name = $inputService->filterName($_POST['name']);
$admin_name = $_POST['name'];
$admin_name = mb_substr($admin_name, 0, 32);
$admin_name = $inputService->filterName($admin_name);
if ($admin_name) {
$poll->admin_name = $admin_name;
$updated = true;