Fix PDO inconsistent types handling
This commit is contained in:
parent
1255240e6d
commit
2f6603a18f
@ -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'];
|
||||
|
@ -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;
|
||||
|
@ -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'];
|
||||
|
Loading…
x
Reference in New Issue
Block a user