Fix ability to update an existing poll (6122)
This commit is contained in:
parent
cd9b00d0e9
commit
6d8c60c88b
@ -35,12 +35,10 @@ class AdminPollService {
|
|||||||
{
|
{
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
$end_date = strtotime($poll->end_date);
|
if ($poll->end_date < $poll->creation_date) {
|
||||||
|
|
||||||
if ($end_date < strtotime($poll->creation_date)) {
|
|
||||||
$poll->end_date = $poll->creation_date;
|
$poll->end_date = $poll->creation_date;
|
||||||
} elseif ($end_date > $this->pollService->maxExpiryDate()) {
|
} elseif ($poll->end_date > $this->pollService->maxExpiryDate()) {
|
||||||
$poll->end_date = utf8_encode(strftime('%Y-%m-%d', $this->pollService->maxExpiryDate()));
|
$poll->end_date = $this->pollService->maxExpiryDate();
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->pollRepository->update($poll);
|
return $this->pollRepository->update($poll);
|
||||||
|
Loading…
Reference in New Issue
Block a user