Skip to content
Snippets Groups Projects
Commit 7837c01b authored by Olivier PEREZ's avatar Olivier PEREZ
Browse files

Fix form control when editing vote

parent 8604cacc
No related branches found
No related tags found
No related merge requests found
...@@ -62,8 +62,8 @@ if (!empty($_POST['save'])) { // Save edition of an old vote ...@@ -62,8 +62,8 @@ if (!empty($_POST['save'])) { // Save edition of an old vote
$editedVote = filter_input(INPUT_POST, 'save', FILTER_VALIDATE_INT); $editedVote = filter_input(INPUT_POST, 'save', FILTER_VALIDATE_INT);
$choices = $inputService->filterArray($_POST['choices'], FILTER_VALIDATE_REGEXP, ['options'=>['regexp'=>'/^[012]$/']]); $choices = $inputService->filterArray($_POST['choices'], FILTER_VALIDATE_REGEXP, ['options'=>['regexp'=>'/^[012]$/']]);
if (empty($name)) { if (empty($editedVote)) {
$message = new Message('danger', _('Name is incorrect.')); $message = new Message('danger', _('Something is going wrong...'));
} }
if (count($choices) != count($_POST['choices'])) { if (count($choices) != count($_POST['choices'])) {
$message = new Message('danger', _('There is a problem with your choices.')); $message = new Message('danger', _('There is a problem with your choices.'));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment