mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 10:24:14 +00:00
avoid doubles
This commit is contained in:
@@ -182,8 +182,20 @@ class Contestcalendar extends CI_Controller {
|
||||
$contestsNextWeekend[] = $contest;
|
||||
}
|
||||
if ($start <= $nextSunday && $end >= $nextFriday) {
|
||||
$contestExists = false;
|
||||
foreach ($contestsNextWeekend as $existingContest) {
|
||||
if ($existingContest['title'] === $contest['title']) {
|
||||
$contestExists = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!$contestExists) {
|
||||
$contestsNextWeekend[] = $contest;
|
||||
$contestsNextWeekend[] = $contest;
|
||||
$contestsNextWeekend[] = $contest;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return $contestsNextWeekend;
|
||||
|
||||
Reference in New Issue
Block a user