Skip to content
Snippets Groups Projects
Unverified Commit 38552da7 authored by Clermonté's avatar Clermonté Committed by Liquidsoul
Browse files

Updated AdminPollService to limit end_date (#336).

parent 324ac9df
No related branches found
No related tags found
No related merge requests found
......@@ -33,10 +33,20 @@ class AdminPollService {
function updatePoll($poll) {
global $config;
if ($poll->end_date > $poll->creation_date) {
return $this->pollRepository->update($poll);
$end_date = strtotime($poll->end_date);
if ($end_date < strtotime($poll->creation_date)) {
$poll->end_date = $poll->creation_date;
} elseif ($end_date > $this->pollService->maxExpiryDate()) {
$poll->end_date = $this->pollService->maxExpiryDate();
}
return false;
return $this->pollRepository->update($poll);
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment