]> Dogcows Code - chaz/p5-File-KDBX/blobdiff - lib/File/KDBX/Loader/XML.pm
Version 0.903
[chaz/p5-File-KDBX] / lib / File / KDBX / Loader / XML.pm
index 412de239f5ea8f62bdde84f48fb62a7df5d20bb2..a5fff506f45481c082a90ff8342b71356423453d 100644 (file)
@@ -11,14 +11,14 @@ use File::KDBX::Error;
 use File::KDBX::Safe;
 use File::KDBX::Util qw(:class :int :text gunzip erase_scoped);
 use Scalar::Util qw(looks_like_number);
-use Time::Piece;
+use Time::Piece 1.33;
 use XML::LibXML::Reader;
 use boolean;
 use namespace::clean;
 
 extends 'File::KDBX::Loader';
 
-our $VERSION = '0.902'; # VERSION
+our $VERSION = '0.903'; # VERSION
 
 has '_reader',  is => 'ro';
 has '_safe',    is => 'ro', default => sub { File::KDBX::Safe->new(cipher => $_[0]->kdbx->random_stream) };
@@ -496,7 +496,7 @@ sub _read_xml_content {
     my $decoded = eval { _decode_primitive($content, $type) };
     if (my $err = $@) {
         ref $err and $err->details(node => $reader->nodePath, line => $reader->lineNumber);
-        throw $err
+        throw $err;
     }
 
     return $decoded;
@@ -536,10 +536,9 @@ sub _decode_datetime {
         $binary .= \0 x (8 - length($binary)) if length($binary) < 8;
         my ($seconds_since_ad1) = unpack_Ql($binary);
         my $epoch = $seconds_since_ad1 - TIME_SECONDS_AD1_TO_UNIX_EPOCH;
-        return Time::Piece->new($epoch);
+        return gmtime($epoch);
     }
 
-
     my $dt = eval { Time::Piece->strptime($_, '%Y-%m-%dT%H:%M:%SZ') };
     if (my $err = $@) {
         throw 'Failed to parse datetime', text => $_, error => $err;
@@ -590,7 +589,7 @@ File::KDBX::Loader::XML - Load unencrypted XML KeePass files
 
 =head1 VERSION
 
-version 0.902
+version 0.903
 
 =head1 BUGS
 
This page took 0.021813 seconds and 4 git commands to generate.