From 50f956957ce3447036133e70069b4778b8f0f959 Mon Sep 17 00:00:00 2001 From: Bubka <858858+Bubka@users.noreply.github.com> Date: Mon, 16 Nov 2020 14:36:02 +0100 Subject: [PATCH] Fix wrong parameter call --- app/TwoFAccount.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/TwoFAccount.php b/app/TwoFAccount.php index 1fbea365..e56e82be 100644 --- a/app/TwoFAccount.php +++ b/app/TwoFAccount.php @@ -326,13 +326,13 @@ public function populate(Array $attrib = []) if (array_key_exists('digits', $attrib) && $attrib['digits'] > 0) { $this->otp->setParameter( 'digits', (int) $attrib['digits'] ); } - if (array_key_exists('digest', $attrib) && $attrib['algorithm']) - { $this->otp->setParameter( 'digest', $attrib['algorithm'] ); } + if (array_key_exists('algorithm', $attrib) && $attrib['algorithm']) + { $this->otp->setParameter( 'algorithm', $attrib['algorithm'] ); } - if (array_key_exists('totpPeriod', $attrib) && $attrib['totpPeriod'] && $attrib['otpType'] !== 'totp') + if (array_key_exists('totpPeriod', $attrib) && $attrib['totpPeriod'] && $attrib['otpType'] === 'totp') { $this->otp->setParameter( 'period', (int) $attrib['totpPeriod'] ); } - if (array_key_exists('hotpCounter', $attrib) && $attrib['hotpCounter'] && $attrib['otpType'] !== 'hotp') + if (array_key_exists('hotpCounter', $attrib) && $attrib['hotpCounter'] && $attrib['otpType'] === 'hotp') { $this->otp->setParameter( 'counter', (int) $attrib['hotpCounter'] ); } if (array_key_exists('imageLink', $attrib) && $attrib['imageLink'])