fixed 0-timestamp for gpx imports. uPosition::add() will fail if timestamp equals 0

This commit is contained in:
rahra 2018-09-18 16:28:27 +02:00 committed by Bartek Fabiszewski
parent 9786e9d25b
commit f4edfe0e33

View File

@ -108,7 +108,7 @@ foreach ($gpx->trk as $trk) {
$track->delete(); $track->delete();
uUtils::exitWithError($lang["iparsefailure"]); uUtils::exitWithError($lang["iparsefailure"]);
} }
$time = isset($point->time) ? strtotime($point->time) : 0; $time = isset($point->time) ? strtotime($point->time) : 1;
$altitude = isset($point->ele) ? (double) $point->ele : NULL; $altitude = isset($point->ele) ? (double) $point->ele : NULL;
$speed = NULL; $speed = NULL;
$bearing = NULL; $bearing = NULL;
@ -142,4 +142,4 @@ foreach ($gpx->trk as $trk) {
// return last track id and tracks count // return last track id and tracks count
uUtils::exitWithSuccess([ "trackid" => $trackId, "trackcnt" => $trackCnt ]); uUtils::exitWithSuccess([ "trackid" => $trackId, "trackcnt" => $trackCnt ]);
?> ?>