Bug 33880: Remove Version param from GB::Barcode->new
Looking at the code here
if (Koha/Auth/TwoFactorAuth.pmoSelf->{Version}){ #--- auto version select
for(->{Version}=1; ->{Version} <= 40; ++->{Version}) {
last if ({->{Ecc}}->[->{Version}]
>= + ->[->{Version}]);
}
}
in https://metacpan.org/release/KWITKNR/GD-Barcode-1.15/source/Barcode/QRcode.pm#L349
It appears the version parameter is not required, and will default to whatever version has the necessary bits for the input words given
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 20d2236681)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 82cd05381a)
Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
This commit is contained in:
parent
f412896691
commit
6b21739774
|
|
@ -101,7 +101,7 @@ sub qr_code {
|
|||
|
||||
my $otpauth = $self->SUPER::qr_code( undef, undef, undef, 1);
|
||||
# no need to pass secret, key and issuer again
|
||||
my $qrcode = GD::Barcode->new( 'QRcode', $otpauth, { Ecc => 'M', Version => 10, ModuleSize => 4 } );
|
||||
my $qrcode = GD::Barcode->new( 'QRcode', $otpauth, { Ecc => 'M', ModuleSize => 4 } );
|
||||
my $data = $qrcode->plot->png;
|
||||
return "data:image/png;base64,". encode_base64( $data, q{} ); # does not contain newlines
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue