Fix wrong parameter call

This commit is contained in:
Bubka 2020-11-16 14:36:02 +01:00
parent 6aa0134818
commit 50f956957c

View File

@ -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'])