Publish and unpublish fields are not validated
skiminki - May 5, 2008 - 19:57
| Project: | Scheduler |
| Version: | 5.x-1.13 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Description
Malformed datetime in publish or unpublish field is not validated properly and makes scheduler behave badly. More specifically, given any datetime that is not recognized by strtotime() is interpreted as 1970-01-01T00:00:00 UTC. Attached is a file that shows the steps to reproduce.
The attached file and the issue originated here: http://drupal.org/node/252116#comment-832689
| Attachment | Size |
|---|---|
| scheduler-mishap.pdf | 30.39 KB |

#1
The problem is that
2008-05-06 24:00:00should actually be2008-05-07 00:00:00. The validation was suggested also in #164271: Proposition for validation function & jsCalendar format.#2
Please test the attached patch (against 5.x-1.13), which implements validation. Validation code is from #164271: Proposition for validation function & jsCalendar format.
#3
#4
#5
Looks like this will work. When I put in the time 24:00:00 I get a msg telling me that I need to enter a valid time. Thanks!
#6
Skiminkis patch keeps me from leaving publish_on and unpublish_on empty, so extended the patch a little.
#7
A very good point indeed, but scheduler-module-255010-3.patch has still a corner case left. If I enter only white spaces to publish_on/unpublish_on, the result is somewhat unexpected...
The attached patch unifies string to time conversion in validation and submit. I wonder if the patch is now ready for commit. Feedback, please ;)
#8
Works for me.
I wait with the utc stuff (#252116: Scheduler should persist timestamps in UTC) until you commit, because of some overlapping changes which will result in some manual merging...
#9
Committed scheduler-module-255010-7.patch
http://drupal.org/cvs?commit=115392
#10
Automatically closed -- issue fixed for two weeks with no activity.