From 5c7a69e57bdbc1afeb045baa89f56d6a2bd809e6 Mon Sep 17 00:00:00 2001 From: Christophe Maudoux Date: Sat, 19 Feb 2022 10:42:07 +0100 Subject: [PATCH] Fix warnings (#2704) --- .../lib/Lemonldap/NG/Common/Combination/Parser.pm | 4 ++-- lemonldap-ng-portal/lib/Lemonldap/NG/Portal/2F/Yubikey.pm | 2 +- lemonldap-ng-portal/t/01-WebAuthn.t | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lemonldap-ng-common/lib/Lemonldap/NG/Common/Combination/Parser.pm b/lemonldap-ng-common/lib/Lemonldap/NG/Common/Combination/Parser.pm index 58e49b253..241eb5912 100644 --- a/lemonldap-ng-common/lib/Lemonldap/NG/Common/Combination/Parser.pm +++ b/lemonldap-ng-common/lib/Lemonldap/NG/Common/Combination/Parser.pm @@ -88,12 +88,12 @@ sub parseAnd { my ( $r, $name ) = $obj->(@_); # Case "string" (form type) - if ( $r & ~$r ) { + if ( $r && $r & ~$r ) { $str{$r}++; } else { return ( wantarray ? ( $r, $name ) : $r ) - unless ( $r == PE_OK ); + unless ( !$r || $r == PE_OK ); } } my $res = %str ? join( ',', keys %str ) : PE_OK; diff --git a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/2F/Yubikey.pm b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/2F/Yubikey.pm index 3735bbf0f..15909872d 100644 --- a/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/2F/Yubikey.pm +++ b/lemonldap-ng-portal/lib/Lemonldap/NG/Portal/2F/Yubikey.pm @@ -122,7 +122,7 @@ sub _findYubikey { } } - return $yubikey; + return $yubikey || ''; } diff --git a/lemonldap-ng-portal/t/01-WebAuthn.t b/lemonldap-ng-portal/t/01-WebAuthn.t index a713289f2..1e7d4632d 100644 --- a/lemonldap-ng-portal/t/01-WebAuthn.t +++ b/lemonldap-ng-portal/t/01-WebAuthn.t @@ -80,7 +80,7 @@ ENDKEY expectForm( $res, "", '/webauthn2fcheck', 'token', 'credential' ); my ($json) = $res->[2]->[0] =~ - m##ms; + m##ms; ok( $json, "Found request object in JS data" ); $json = from_json($json); my $request = $json->{request};