Use of a 'local' variable causes the TZ to be dropped prematurely. So,
instead, we set $ENV{TZ} globally and reset it when the mod_perl handler
object is destroyed.
Signed-off-by: Mike Rylander <mrylander@gmail.com>
return $self;
}
+sub DESTROY {
+ my $self = shift;
+ $ENV{TZ} = $self->ctx->{original_tz}
+ if ($self->ctx && exists $self->ctx->{original_tz});
+}
# current Apache2::RequestRec;
sub apache {
$ctx->{unparsed_uri} = $self->apache->unparsed_uri;
$ctx->{opac_root} = $ctx->{base_path} . "/opac"; # absolute base url
- local $ENV{TZ} = $ctx->{client_tz};
+ $ctx->{original_tz} = $ENV{TZ};
+ $ENV{TZ} = $ctx->{client_tz};
my $xul_wrapper =
($self->apache->headers_in->get('OILS-Wrapper') || '') =~ /true/;