From 303edfc83a06766f0a1526810ac697e6e5e5d2e5 Mon Sep 17 00:00:00 2001 From: Martin Fischer Date: Sat, 8 Oct 2022 09:18:02 +0200 Subject: don't count votes after end date Thanks to waldyrious for the suggestion! --- Vote.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Vote.php') diff --git a/Vote.php b/Vote.php index e72fb07..b7f9724 100644 --- a/Vote.php +++ b/Vote.php @@ -78,6 +78,10 @@ class VoteHooks { array_push($lines, ['error' => $msg('vote-error-invalid-date'), 'line' => $line]); continue; } + if ($endDate && $vote['date'] > $endDate) { + array_push($lines, ['error' => $msg('vote-error-too-late'), 'line' => $line]); + continue; + } if (!in_array($vote['vote'], self::$options)) { array_push($lines, ['error' => $msg('vote-error-invalid-vote', '(YES, NO, ABSTAIN)'), 'line' => $line]); continue; -- cgit v1.2.3