Fix submitting form with expiration-date.

Signed-off-by: Jonas Rittershofer <jotoeri@users.noreply.github.com>
This commit is contained in:
Jonas Rittershofer 2020-06-17 23:17:52 +02:00
parent 3ea677fe25
commit d55f14f53f

View file

@ -687,8 +687,8 @@ class ApiController extends Controller {
return new Http\JSONResponse(['message' => 'Not allowed to access this form'], Http::STATUS_FORBIDDEN);
}
// Not allowed if form expired
if ($form->getExpires() > time()) {
// Not allowed if form expired. Expires is '0' if the form does not expire.
if ($form->getExpires() && $form->getExpires() < time()) {
return new Http\JSONResponse(['message' => 'This form is no longer taking answers'], Http::STATUS_FORBIDDEN);
}