Merge pull request #469 from nextcloud/fix/submit_expires

Fix submitting form with expiration-date.
This commit is contained in:
John Molakvoæ 2020-06-18 11:31:22 +02:00 committed by GitHub
commit 438c539474
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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);
}