headers: use a more descriptive variable name
This commit is contained in:
parent
895264469f
commit
4d1b9ffe32
@ -196,20 +196,20 @@ sub invalid_date_range {
|
|||||||
my $date = shift || $self->transaction->header->get('Date') or return;
|
my $date = shift || $self->transaction->header->get('Date') or return;
|
||||||
chomp $date;
|
chomp $date;
|
||||||
|
|
||||||
my $ts = str2time($date) or do {
|
my $msg_ts = str2time($date) or do {
|
||||||
$self->log(LOGINFO, "skip, date not parseable ($date)");
|
$self->log(LOGINFO, "skip, date not parseable ($date)");
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
|
|
||||||
my $past = $self->{_args}{past};
|
my $past = $self->{_args}{past};
|
||||||
if ($past && $ts < time - ($past * 24 * 3600)) {
|
if ($past && $msg_ts < time - ($past * 24 * 3600)) {
|
||||||
$self->log(LOGINFO, "fail, date too old ($date)");
|
$self->log(LOGINFO, "fail, date too old ($date)");
|
||||||
$self->adjust_karma(-1);
|
$self->adjust_karma(-1);
|
||||||
return "The Date header is too far in the past";
|
return "The Date header is too far in the past";
|
||||||
}
|
}
|
||||||
|
|
||||||
my $future = $self->{_args}{future};
|
my $future = $self->{_args}{future};
|
||||||
if ($future && $ts > time + ($future * 24 * 3600)) {
|
if ($future && $msg_ts > time + ($future * 24 * 3600)) {
|
||||||
$self->log(LOGINFO, "fail, date in future ($date)");
|
$self->log(LOGINFO, "fail, date in future ($date)");
|
||||||
$self->adjust_karma(-1);
|
$self->adjust_karma(-1);
|
||||||
return "The Date header is too far in the future";
|
return "The Date header is too far in the future";
|
||||||
|
Loading…
Reference in New Issue
Block a user