Skip to content

Commit

Permalink
Fixed 32-bit integer overflow by allowing UTCDateTime() to get it's o…
Browse files Browse the repository at this point in the history
…wn current time (#1127)
  • Loading branch information
macdabby authored and jenssegers committed Feb 23, 2017
1 parent e4d7428 commit db1c5ea
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Jenssegers/Mongodb/Auth/DatabaseTokenRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class DatabaseTokenRepository extends BaseDatabaseTokenRepository
*/
protected function getPayload($email, $token)
{
return ['email' => $email, 'token' => $token, 'created_at' => new UTCDateTime(round(microtime(true) * 1000))];
return ['email' => $email, 'token' => $token, 'created_at' => new UTCDateTime(null)];
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Jenssegers/Mongodb/Eloquent/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ protected function getDateFormat()
*/
public function freshTimestamp()
{
return new UTCDateTime((int) round(microtime(true) * 1000));
return new UTCDateTime(null);
}

/**
Expand Down

0 comments on commit db1c5ea

Please sign in to comment.