Bug 36940: Resolve two warnings on undefined branchip

If you enabled AutoLocation and have a branch without ip, this
triggers warnings.

Test plan:
Check logs in this situation with/without this patch by logging out
and in again on staff.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 2f1ffbc6ec)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Marcel de Rooy 2024-05-23 08:47:50 +00:00 committed by Lucas Gass
parent e7afd54cc8
commit 2d4537ba12
1 changed files with 2 additions and 2 deletions

View File

@ -1218,10 +1218,10 @@ sub checkauth {
my $branches = { map { $_->branchcode => $_->unblessed } Koha::Libraries->search->as_list };
if ( C4::Context->preference('StaffLoginRestrictLibraryByIP') ) {
# we have to check they are coming from the right ip range
my $domain = $branches->{$branchcode}->{'branchip'};
my $domain = $branches->{$branchcode}->{'branchip'} // q{};
$domain =~ s|\.\*||g;
$domain =~ s/\s+//g;
if ( $ip !~ /^$domain/ ) {
if ( $domain && $ip !~ /^$domain/ ) {
$cookie = $cookie_mgr->replace_in_list( $cookie, $query->cookie(
-name => 'CGISESSID',
-value => '',