From 02f8c41030a3f177f7cab5ba66843dc57bfae1eb Mon Sep 17 00:00:00 2001 From: Xavier Guimard Date: Thu, 29 Nov 2018 17:00:28 +0100 Subject: [PATCH] Fix little warnings (#1559) --- lemonldap-ng-common/lib/Lemonldap/NG/Common/Session.pm | 5 ++++- lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Main/Jail.pm | 4 +++- .../t/20-Auth-and-password-DBI-dynamic-hash.t | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/lemonldap-ng-common/lib/Lemonldap/NG/Common/Session.pm b/lemonldap-ng-common/lib/Lemonldap/NG/Common/Session.pm index 44adca3b5..eceac2b6d 100644 --- a/lemonldap-ng-common/lib/Lemonldap/NG/Common/Session.pm +++ b/lemonldap-ng-common/lib/Lemonldap/NG/Common/Session.pm @@ -13,7 +13,10 @@ use Lemonldap::NG::Common::Apache::Session; # Workaround for another ModPerl/Mouse issue... BEGIN { require Mouse; - my $v = sprintf( "%d.%03d%03d", ( $Mouse::VERSION =~ /(\d+)/g ) ); + my $v = + $Mouse::VERSION + ? sprintf( "%d.%03d%03d", ( $Mouse::VERSION =~ /(\d+)/g ) ) + : 0; if ( $v < 2.005001 and $Lemonldap::NG::Handler::Apache2::Main::VERSION ) { require Moose; Moose->import(); diff --git a/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Main/Jail.pm b/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Main/Jail.pm index 89ff0899e..d4f32cd86 100644 --- a/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Main/Jail.pm +++ b/lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Main/Jail.pm @@ -8,7 +8,9 @@ use Lemonldap::NG::Common::Safelib; #link protected safe Safe object # Workaround for another ModPerl/Mouse issue... BEGIN { require Mouse; - my $v = sprintf( "%d.%03d%03d", ( $Mouse::VERSION =~ /(\d+)/g ) ); + my $v = $Mouse::VERSION + ? sprintf( "%d.%03d%03d", ( $Mouse::VERSION =~ /(\d+)/g ) ) + : 0; if ( $v < 2.005001 and $Lemonldap::NG::Handler::Apache2::Main::VERSION ) { require Moose; Moose->import(); diff --git a/lemonldap-ng-portal/t/20-Auth-and-password-DBI-dynamic-hash.t b/lemonldap-ng-portal/t/20-Auth-and-password-DBI-dynamic-hash.t index ef3cc4b82..7c6e4edca 100644 --- a/lemonldap-ng-portal/t/20-Auth-and-password-DBI-dynamic-hash.t +++ b/lemonldap-ng-portal/t/20-Auth-and-password-DBI-dynamic-hash.t @@ -190,7 +190,7 @@ SKIP: { 'Authentication against newly-modified password' ); expectOK($res); - my $id = expectCookie($res); + $id = expectCookie($res); # Verify that password is hashed with correct scheme (dbiDynamicHashNewPasswordScheme) my $sth = $dbh->prepare("SELECT password FROM users WHERE user='jsmith';"); -- GitLab