Bug 25491: Fix for "Use of uninitialized value" in InstallAuth.pm
authorSlava Shishkin <slavashishkin@gmail.com>
Wed, 13 May 2020 17:20:27 +0000 (20:20 +0300)
committerLucas Gass <lucas@bywatersolutions.com>
Mon, 13 Jul 2020 16:00:05 +0000 (16:00 +0000)
commit3a3237da9c2f107a9d4e4a9e9383316ce10e6ecc
treef4552ee515cfe61d82e4223ca935b5ebdda0e252
parenta5e4c9b57e80e4a6453b6adbe13b7e24dd06c66c
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 <nugged@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit d81438e143273a538c09cd16e7f92a83beed4027)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
C4/InstallAuth.pm