diff options
author | Sebastian Schweizer <sebastian@schweizer.tel> | 2017-06-22 11:57:27 +0200 |
---|---|---|
committer | Sebastian Schweizer <sebastian@schweizer.tel> | 2017-06-22 11:57:27 +0200 |
commit | 1ce103e42170e86910af23e3529e76bdeb59f5a8 (patch) | |
tree | 4715a9fc40cbfa221a4d5b414933e0784c317506 | |
parent | a0687e511e9cba96c41abd086fe3f322dddf6a67 (diff) | |
download | google2fa-1ce103e42170e86910af23e3529e76bdeb59f5a8.zip google2fa-1ce103e42170e86910af23e3529e76bdeb59f5a8.tar.gz google2fa-1ce103e42170e86910af23e3529e76bdeb59f5a8.tar.bz2 |
fix null timestamp issue in verifyKeyNewer
-rw-r--r-- | src/Google2FA.php | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Google2FA.php b/src/Google2FA.php index f66e4aa..2f752b2 100644 --- a/src/Google2FA.php +++ b/src/Google2FA.php @@ -350,8 +350,10 @@ class Google2FA */ public function verifyKey($secret, $key, $window = null, $timestamp = null, $oldTimestamp = '__not_set__') { + $timestamp = $this->makeTimestamp($timestamp); + $startingTimestamp = $oldTimestamp === '__not_set__' - ? ($timestamp = $this->makeTimestamp($timestamp)) - $this->getWindow($window) + ? $timestamp - $this->getWindow($window) : max($timestamp - $this->getWindow($window), $oldTimestamp + 1); return $this->findValidOTP( |