Repository navigation
Conversation
a39498a to
d4898e5
Compare
bbb003d to
1c77d11
Compare
|
Hello there, 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.) |
f1367fc to
72c807d
Compare
72c807d to
7986cfb
Compare
3fa2f80 to
08157ee
Compare
Signed-off-by: Bahman Jafarzadeh <bahman026@gmail.com>
Signed-off-by: Bahman Jafarzadeh <bahman026@gmail.com>
Signed-off-by: Bahman Jafarzadeh <bahman026@gmail.com>
Signed-off-by: Bahman Jafarzadeh <bahman026@gmail.com>
08157ee to
9be1702
Compare
Signed-off-by: bahman <42313073+bahman026@users.noreply.github.com>
The 'date' rule only accepted two of the formats that the API actually receives, and relied on \DateTime to reject the rest. \DateTime silently misreads out of range input instead of failing: '12345-01-01' is parsed as 2005-01-01 12:34. Such a value is written to the DATETIME column but can no longer be read back, which leaves the card permanently broken. Match the value against an explicit list of accepted formats and reject overflowing components (month 13, February 30), which createFromFormat() only reports through its warnings. An empty value stays valid so optional dates can be unset. Validate startdate the same way as duedate, and check both of them on create() as well - previously only update() checked duedate, so an invalid date could still enter the database through card creation. On the frontend, bound the native datetime-local input on both ends instead of only the upper one, so a year like 20250 can no longer be typed. Signed-off-by: bahman026 <bahman026@gmail.com>
…r-input # Conflicts: # lib/Service/CardService.php
The start date ends up in the same DATETIME column as the due date and is now validated the same way server side, so the picker needs the same range. Without it a year like 20250 is still accepted by the input and only rejected once the request reaches the validator. Move the two bounds into a shared helper rather than repeating them in both selectors. Signed-off-by: bahman026 <bahman026@gmail.com>
createFromFormat() does not bound 'Y' to four digits - it consumes as many digits as it finds, so '12345-01-01' and '20250-12-09 04:30:00' parse cleanly and produce no warnings, and the format list alone let them through. Compare the parsed year against the range the DATETIME column can hold, which is also the range the date pickers now offer. Signed-off-by: bahman026 <bahman026@gmail.com>
|
Hi @luka-nextcloud, Following your approval, I’ve extended the fix with a few additional validations:
The latest commits are currently waiting for CI approval. Could you please approve the workflow runs and review the updated changes when you have a chance? Thank you. |
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:
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