Don't allow ',' in slot labels

This commit is contained in:
Olivier PEREZ 2015-10-05 23:59:43 +02:00
parent d17ba242d3
commit 892fa11373

View File

@ -394,12 +394,12 @@ if (isset($_GET['add_slot'])) {
if (isset($_POST['confirm_add_slot'])) { if (isset($_POST['confirm_add_slot'])) {
if ($poll->format === 'D') { if ($poll->format === 'D') {
$newdate = strip_tags($_POST['newdate']); $newdate = strip_tags($_POST['newdate']);
$newmoment = strip_tags($_POST['newmoment']); $newmoment = str_replace(',', '-', strip_tags($_POST['newmoment']));
$ex = explode('/', $newdate); $ex = explode('/', $newdate);
$result = $adminPollService->addDateSlot($poll_id, mktime(0, 0, 0, $ex[1], $ex[0], $ex[2]), $newmoment); $result = $adminPollService->addDateSlot($poll_id, mktime(0, 0, 0, $ex[1], $ex[0], $ex[2]), $newmoment);
} else { } else {
$newslot = strip_tags($_POST['choice']); $newslot = str_replace(',', '-', strip_tags($_POST['choice']));
$result = $adminPollService->addClassicSlot($poll_id, $newslot); $result = $adminPollService->addClassicSlot($poll_id, $newslot);
} }