diff --git a/helpers/position.php b/helpers/position.php index 185cf56..e969253 100644 --- a/helpers/position.php +++ b/helpers/position.php @@ -427,18 +427,18 @@ require_once(ROOT_DIR . "/helpers/upload.php"); */ private static function rowToObject($row) { $position = new uPosition(); - $position->id = $row['id']; - $position->timestamp = $row['tstamp']; - $position->userId = $row['user_id']; + $position->id = (int) $row['id']; + $position->timestamp = (int) $row['tstamp']; + $position->userId = (int) $row['user_id']; $position->userLogin = $row['login']; - $position->trackId = $row['track_id']; + $position->trackId = (int) $row['track_id']; $position->trackName = $row['name']; - $position->latitude = $row['latitude']; - $position->longitude = $row['longitude']; - $position->altitude = $row['altitude']; - $position->speed = $row['speed']; - $position->bearing = $row['bearing']; - $position->accuracy = $row['accuracy']; + $position->latitude = (double) $row['latitude']; + $position->longitude = (double) $row['longitude']; + $position->altitude = (double) $row['altitude']; + $position->speed = (double) $row['speed']; + $position->bearing = (double) $row['bearing']; + $position->accuracy = (int) $row['accuracy']; $position->provider = $row['provider']; $position->comment = $row['comment']; $position->image = $row['image']; diff --git a/helpers/track.php b/helpers/track.php index aa19ef1..6010d41 100644 --- a/helpers/track.php +++ b/helpers/track.php @@ -234,8 +234,8 @@ */ private static function rowToObject($row) { $track = new uTrack(); - $track->id = $row['id']; - $track->userId = $row['user_id']; + $track->id = (int) $row['id']; + $track->userId = (int) $row['user_id']; $track->name = $row['name']; $track->comment = $row['comment']; $track->isValid = true; diff --git a/helpers/user.php b/helpers/user.php index 9a3e3bb..b878343 100644 --- a/helpers/user.php +++ b/helpers/user.php @@ -230,7 +230,7 @@ */ private static function rowToObject($row) { $user = new uUser(); - $user->id = $row['id']; + $user->id = (int) $row['id']; $user->login = $row['login']; $user->hash = $row['password']; $user->isAdmin = (bool) $row['admin'];