Undefined offset: 0 in /var/www/framadate/create_date_poll.php on line 143 in 1.1.16
If you want to create a date poll with the first input for date and time empty, it will not display any choices at the next site but the notice to the undefined offset.
Error is in line 114
$_POST['days'] = array_filter($_POST['days'], function ($d) {
return !empty($d);
});
Code does not return an array when the first input is empty!!
Results from debugging the case:
Output from development tools:
Before and after the filter with the first input filled:
Response: Array(3) [ "2021-05-12", "", "" ]
Response: Array [ "2021-05-12" ]
Before and after the filter with the first input unfilled:
Response: Array(3) [ "", "2021-05-12", "" ]
Response: Object { 1: "2021-05-12" }