Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
fix(files_reminder): prevent setting reminder in the past
Signed-off-by: skjnldsv <[email protected]>
  • Loading branch information
skjnldsv committed Nov 26, 2025
commit 06e3a69c260d488648534418cb1e2c1a08ba3fa5
4 changes: 4 additions & 0 deletions apps/files_reminders/lib/Controller/ApiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ public function get(int $fileId): DataResponse {
public function set(int $fileId, string $dueDate): DataResponse {
try {
$dueDate = (new DateTime($dueDate))->setTimezone(new DateTimeZone('UTC'));
$nowDate = (new DateTime('now'))->setTimezone(new DateTimeZone('UTC'));
if ($dueDate <= $nowDate) {
return new DataResponse([], Http::STATUS_BAD_REQUEST);
}
} catch (Exception $e) {
$this->logger->error($e->getMessage(), ['exception' => $e]);
return new DataResponse([], Http::STATUS_BAD_REQUEST);
Expand Down