diff --git a/web/functions_ical.inc b/web/functions_ical.inc index 35cb2a13c2..6ec809efc5 100644 --- a/web/functions_ical.inc +++ b/web/functions_ical.inc @@ -706,6 +706,7 @@ function export_icalendar(DBStatement $res, bool $keep_private, int $export_end= for ($i=0; (false !== ($row = $res->next_row_keyed())); $i++) { + row_cast_columns($row, 'entry'); unpack_status($row); // If this is an individual entry, then construct an event if (!isset($row['rep_type']) || ($row['rep_type'] == RepeatRule::NONE)) diff --git a/web/lib/MRBS/ICalendar/Series.php b/web/lib/MRBS/ICalendar/Series.php index b29faec20b..531a4c32b0 100644 --- a/web/lib/MRBS/ICalendar/Series.php +++ b/web/lib/MRBS/ICalendar/Series.php @@ -120,10 +120,10 @@ private static function addRepeatRule(array $row) : array { // Construct the repeat rule and add it to the row $repeat_rule = new RepeatRule(); - $repeat_rule->setType($row['rep_type']); - $repeat_rule->setInterval($row['rep_interval']); + $repeat_rule->setType((int)$row['rep_type']); + $repeat_rule->setInterval((int)$row['rep_interval']); $repeat_end_date = new DateTime(); - $repeat_end_date->setTimestamp($row['end_date']); + $repeat_end_date->setTimestamp((int)$row['end_date']); $repeat_rule->setEndDate($repeat_end_date); $repeat_rule->setDaysFromOpt($row['rep_opt']); diff --git a/web/mrbs_sql.inc b/web/mrbs_sql.inc index acb4ba4a89..22d15fd389 100644 --- a/web/mrbs_sql.inc +++ b/web/mrbs_sql.inc @@ -1518,7 +1518,14 @@ function get_repeat(int $repeat_id) : ?array $res = db()->query($sql, array(':repeat_id' => $repeat_id)); - return ($res->count() == 0) ? null : $res->next_row_keyed(); + if (($res->count() == 0)) + { + return null; + } + $row = $res->next_row_keyed(); + row_cast_columns($row, 'repeat'); + + return $row; } // Update the time of last reminding.