mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-20 07:16:03 +00:00
statistics2.cgi: check $rev for proper value
git-svn-id: https://svn.fhem.de/fhem/trunk@14618 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
686c1a0619
commit
eca374e5bd
@ -93,11 +93,13 @@ sub insertDB() {
|
|||||||
if (defined($decoded->{'system'}{'revision'})) {
|
if (defined($decoded->{'system'}{'revision'})) {
|
||||||
# replace revision number with revision date
|
# replace revision number with revision date
|
||||||
my $rev = $decoded->{'system'}{'revision'};
|
my $rev = $decoded->{'system'}{'revision'};
|
||||||
|
if($rev =~ /^\d+$/) {
|
||||||
my $d = (split(/ /,qx(sudo -u rko /usr/bin/svn info -r $rev $fhemPathSvn|grep Date:)))[3];
|
my $d = (split(/ /,qx(sudo -u rko /usr/bin/svn info -r $rev $fhemPathSvn|grep Date:)))[3];
|
||||||
my ($year,$mon,$mday) = split(/-/,$d);
|
my ($year,$mon,$mday) = split(/-/,$d);
|
||||||
$decoded->{'system'}{'revdate'} = mktime(0,0,7,$mday,($mon-1),($year-1900),0,0,0);
|
$decoded->{'system'}{'revdate'} = mktime(0,0,7,$mday,($mon-1),($year-1900),0,0,0);
|
||||||
$json = encode_json $decoded;
|
$json = encode_json $decoded;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$sth = $dbh->prepare(q{INSERT OR REPLACE INTO jsonNodes(uniqueID,geo,json) VALUES(?,?,?)});
|
$sth = $dbh->prepare(q{INSERT OR REPLACE INTO jsonNodes(uniqueID,geo,json) VALUES(?,?,?)});
|
||||||
my $result = $sth->execute($uniqueID,$geo,$json);
|
my $result = $sth->execute($uniqueID,$geo,$json);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user