Details
Description
I've just realised there's quite a serious race condition for how repeat events are handled in the calendar. I thought the repeatid column just pointed to the id of the original event.
But, no:
if ($form->repeat) {
$fetch = get_record_sql('SELECT 1, MAX(repeatid) AS repeatid FROM '.$CFG->prefix.'event');
$form->repeatid = empty($fetch) ? 1 : $fetch->repeatid + 1;
}
cvs:/calendar/edit.php