Skip to content

Conversation

@bahman026
Copy link

@bahman026 bahman026 commented Dec 8, 2025

  • Target version: main

Summary

This PR fixes an issue where a user can manually enter an invalid year in the due date input (for example: 20250).
Although the UI displays a date picker, users can still type values directly into the datetime-local field. When an invalid 5-digit year is submitted, it is saved in the database without validation.

After refreshing the page, PHP throws an error such as:

Failed to parse time string (20250-12-09 04:30:00) at position 12 (0):
Double time specification

Before:
Because of this invalid date, the card cannot be edited or updated again until the entire board is deleted.

screen-capture.mp4

After:

capture.mp4

Checklist

  • Code is properly formatted
  • Sign-off message is added to all commits
  • Documentation (manuals or wiki) has been updated or is not required

@bahman026 bahman026 force-pushed the prevent-invalid-year-input branch 4 times, most recently from a39498a to d4898e5 Compare December 9, 2025 14:31
bahman added 4 commits December 20, 2025 11:50
    - Set maximum date to December 31, 9999

Signed-off-by: bahman <bja@adlas.at>
- Implemented date validation using DateTime::createFromFormat
- Supports both 'Y-m-d\TH:i:s.v\Z' and ATOM formats
- Returns boolean indicating if value is valid date

Signed-off-by: bahman <bja@adlas.at>
- Added date validation for duedate field in CardServiceValidator

Signed-off-by: bahman <bja@adlas.at>
- Added 'duedate' parameter to the validation check in update method

Signed-off-by: bahman <bja@adlas.at>
@rakekniven rakekniven force-pushed the prevent-invalid-year-input branch from bbb003d to 1c77d11 Compare December 20, 2025 10:50
@github-actions
Copy link
Contributor

Hello there,
Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.

We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process.

Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6

Thank you for contributing to Nextcloud and we hope to hear from you soon!

(If you believe you should not receive this message, you can add yourself to the blocklist.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant