Fix the change of expiration date check which was too loose.

This commit is contained in:
Antonin 2015-05-29 17:36:13 +02:00
parent 4cacb412c6
commit 755580463d

View File

@ -111,7 +111,8 @@ if (isset($_POST['update_poll_info'])) {
break;
}
} elseif ($field == 'expiration_date') {
$expiration_date = filter_input(INPUT_POST, 'expiration_date', FILTER_VALIDATE_REGEXP, ['options' => ['regexp' => '#^[0-9]+[-/][0-9]+[-/][0-9]+#']]);
$expiration_date = filter_input(INPUT_POST, 'expiration_date', FILTER_VALIDATE_REGEXP,
['options' => ['regexp' => '#^[0-9]{4}-[0-9]{2}-[0-9]{2}$#']]);
if ($expiration_date) {
$poll->end_date = $expiration_date;
$updated = true;