Merge remote-tracking branch 'igorsantos/qr-logos'

This commit is contained in:
William Hall
2021-03-09 18:09:38 +00:00
5 changed files with 50 additions and 7 deletions
+2 -2
View File
@@ -143,7 +143,7 @@ class TwoFactorAuth
*/
public function verifyCode($secret, $code, $discrepancy = 1, $time = null, &$timeslice = 0)
{
$timetamp = $this->getTime($time);
$timestamp = $this->getTime($time);
$timeslice = 0;
@@ -152,7 +152,7 @@ class TwoFactorAuth
// of the match. Each iteration we either set the timeslice variable to the timeslice of the match
// or set the value to itself. This is an effort to maintain constant execution time for the code.
for ($i = -$discrepancy; $i <= $discrepancy; $i++) {
$ts = $timetamp + ($i * $this->period);
$ts = $timestamp + ($i * $this->period);
$slice = $this->getTimeSlice($ts);
$timeslice = $this->codeEquals($this->getCode($secret, $ts), $code) ? $slice : $timeslice;
}