Summary: | Double processing invalid dates can lead to ISE | ||
---|---|---|---|
Product: | Koha | Reporter: | Martin Renvoize (ashimema) <martin.renvoize> |
Component: | Architecture, internals, and plumbing | Assignee: | Martin Renvoize (ashimema) <martin.renvoize> |
Status: | CLOSED FIXED | QA Contact: | Marcel de Rooy <m.de.rooy> |
Severity: | major | ||
Priority: | P5 - low | CC: | andrew, jonathan.druart, kyle, m.de.rooy, nick, tomascohen, victor, wainuiwitikapark |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
GIT URL: | Change sponsored?: | --- | |
Patch complexity: | Trivial patch | Documentation contact: | |
Documentation submission: | Text to go in the release notes: | ||
Version(s) released in: |
22.05.00,21.11.06,21.05.15,20.11.19
|
Circulation function: | |
Bug Depends on: | 29403 | ||
Bug Blocks: | 30717 | ||
Attachments: |
Bug 30540: eval on set_time_zone
Bug 30540: Unit test Bug 30540: eval on set_time_zone Bug 30540: Unit test Bug 30540: eval on set_time_zone Bug 30540: Fix perl critic complaint of leading zeros Bug 30540: Unit test Bug 30540: eval on set_time_zone Bug 30540: Fix perl critic complaint of leading zeros |
Description
Martin Renvoize (ashimema)
2022-04-14 07:40:04 UTC
Created attachment 133290 [details] [review] Bug 30540: eval on set_time_zone This patch adds an eval around the call to set_time_zone so that we don't crash on invalid local dates and instead just keep the passed floating timezone. 2017-03-26 01:35:00 is such a date in Europe/London time.. it's a DST boundary day so anything between 12.59.59 and 02.00.00 doesn't exist ;) Set any checkout date in the database to this and set your tz config to Europe/London and you'll find the issuehistory page will crash without the patch here. Unit test to follow.. once my brain has worked out how to write one. Created attachment 133292 [details] [review] Bug 30540: Unit test This patch adds tests for checking the output_pref method against a timezone and datetime that would cause an Invalid local time failure To test: 1. Apply this patch 2. Run: $ kshell k$ prove t/DateUtils.t => FAIL: The feature is not implemented, tests fail to complete Created attachment 133293 [details] [review] Bug 30540: eval on set_time_zone This patch adds an eval around the call to set_time_zone so that we don't crash on invalid local dates and instead just keep the passed floating timezone. Created attachment 133297 [details] [review] Bug 30540: Unit test This patch adds tests for checking the output_pref method against a timezone and datetime that would cause an Invalid local time failure To test: 1. Apply this patch 2. Run: $ kshell k$ prove t/DateUtils.t => FAIL: The feature is not implemented, tests fail to complete Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 133298 [details] [review] Bug 30540: eval on set_time_zone This patch adds an eval around the call to set_time_zone so that we don't crash on invalid local dates and instead just keep the passed floating timezone. Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 133299 [details] [review] Bug 30540: Fix perl critic complaint of leading zeros Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 133336 [details] [review] Bug 30540: Unit test This patch adds tests for checking the output_pref method against a timezone and datetime that would cause an Invalid local time failure To test: 1. Apply this patch 2. Run: $ kshell k$ prove t/DateUtils.t => FAIL: The feature is not implemented, tests fail to complete Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Created attachment 133337 [details] [review] Bug 30540: eval on set_time_zone This patch adds an eval around the call to set_time_zone so that we don't crash on invalid local dates and instead just keep the passed floating timezone. Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Created attachment 133338 [details] [review] Bug 30540: Fix perl critic complaint of leading zeros Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Pushed to master for 22.05, thanks to everybody involved [U+1F984] Please rebase and ping me if needed in 21.11, I tried but get an error on the unit test. Pushed to 21.11.x for 21.11.06 Pushed to 21.05.x for 21.05.15 Backported: Pushed to 20.11.x branch for 20.11.19 Does this need to be backported to 19.11.x? |