From 9a64956e11b3492cfa3f57097fb6942f783805ea Mon Sep 17 00:00:00 2001 From: Slava Shishkin Date: Wed, 13 May 2020 20:20:27 +0300 Subject: [PATCH] Bug 25491: Fix for "Use of uninitialized value" in InstallAuth.pm This warning was thrown: Use of uninitialized value $info{"invalid_username_or_password"} in numeric eq (==) at /home/vagrant/kohaclone/C4/InstallAuth.pm line 387. There is the case when hash key can be undefined in numeric comparison. Fixed by adding additional precheck for $info{"invalid_username_or_password"} being Perl's "true". To test: 1) Go to the first page of the web-installer where it asks to login. 2) Observe the warning in the log file. 3) Apply patch. 4) Repeat step 1. 7) Check that previous warning suppressed. Mentored-by: Andrew Nugged Signed-off-by: Martin Renvoize Signed-off-by: Jonathan Druart (cherry picked from commit d81438e143273a538c09cd16e7f92a83beed4027) Signed-off-by: Lucas Gass (cherry picked from commit 3a3237da9c2f107a9d4e4a9e9383316ce10e6ecc) Signed-off-by: Aleisha Amohia (cherry picked from commit 0d9ea88b86ea48142aabdb4eea6efb4b98eae3f1) Signed-off-by: Victor Grousset/tuxayo --- C4/InstallAuth.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/C4/InstallAuth.pm b/C4/InstallAuth.pm index 67319b3db6..84817ce8ad 100644 --- a/C4/InstallAuth.pm +++ b/C4/InstallAuth.pm @@ -385,7 +385,7 @@ sub checkauth { $template->param( login => 1 ); $template->param( loginprompt => 1 ) unless $info{'nopermission'}; - if ($info{'invalid_username_or_password'} == 1) { + if ($info{'invalid_username_or_password'} && $info{'invalid_username_or_password'} == 1) { $template->param( 'invalid_username_or_password' => $info{'invalid_username_or_password'}); } -- 2.39.5