From c93d6ba4d2ce64b6e1512b164b862a8a521530e3 Mon Sep 17 00:00:00 2001 From: Roy Johnson Date: Wed, 14 Jun 2006 16:23:20 +0000 Subject: [PATCH] fix: ?op=listTransactions causes fatal Session/DateTime addToTime, addToDate, and addToDateTime now default to the current epoch as a starting point. --- docs/changelog/6.x.x.txt | 3 ++- lib/WebGUI/Session/DateTime.pm | 12 ++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/docs/changelog/6.x.x.txt b/docs/changelog/6.x.x.txt index 70649d004..13fd83de0 100644 --- a/docs/changelog/6.x.x.txt +++ b/docs/changelog/6.x.x.txt @@ -41,7 +41,8 @@ - Fixed a macro processing problem on the Redirect asset. - Added a log info entry when a redirect occurs. - Better handling of automated messages and post bounces for CS Mail. - + - fix: op=listTransactions causes fatal + - Session/DateTime addToDate, addToTime, and addToDateTime now default to the current epoch for a starting point. 6.99.3 - Someone removed the status from the submission templates. That has been diff --git a/lib/WebGUI/Session/DateTime.pm b/lib/WebGUI/Session/DateTime.pm index 3e6559fbe..55fa37c96 100644 --- a/lib/WebGUI/Session/DateTime.pm +++ b/lib/WebGUI/Session/DateTime.pm @@ -85,7 +85,7 @@ Returns an epoch date with the amount of time added. =head3 epoch -The number of seconds since January 1, 1970. +The number of seconds since January 1, 1970. Defaults to current date/time. =head3 years @@ -103,7 +103,7 @@ The number of days to add to the epoch. sub addToDate { my $self = shift; - my $epoch = shift; + my $epoch = shift || time(); my $years = shift || 0; my $months = shift || 0; my $days = shift || 0; @@ -121,7 +121,7 @@ Returns an epoch date with the amount of time added. =head3 epoch -The number of seconds since January 1, 1970. +The number of seconds since January 1, 1970. Defaults to current date/time. =head3 years @@ -151,7 +151,7 @@ The number of seconds to add to the epoch. sub addToDateTime { my $self = shift; - my $epoch = shift; + my $epoch = shift || time(); my $years = shift || 0; my $months = shift || 0; my $days = shift || 0; @@ -172,7 +172,7 @@ Returns an epoch date with the amount of time added. =head3 epoch -The number of seconds since January 1, 1970. +The number of seconds since January 1, 1970. Defaults to current date/time. =head3 hours @@ -190,7 +190,7 @@ The number of seconds to add to the epoch. sub addToTime { my $self = shift; - my $epoch = shift; + my $epoch = shift || time(); my $hours = shift || 0; my $mins = shift || 0; my $secs = shift || 0;