From 880ce267762d28c8cd853e451ff6a5d229f8baea Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Mon, 24 Jan 2022 13:06:33 +0000 Subject: [PATCH] Bug 29931: (follow-up) Similar thing in opac-patron-image.pl Content-Type: text/plain; charset=utf-8 Although less harmful indeed. No borrowernumber, no image. --- opac/opac-patron-image.pl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/opac/opac-patron-image.pl b/opac/opac-patron-image.pl index df1efdf4ef..b1f941e099 100755 --- a/opac/opac-patron-image.pl +++ b/opac/opac-patron-image.pl @@ -35,7 +35,13 @@ unless (C4::Context->preference('OPACpatronimages')) { my $needed_flags; my %cookies = CGI::Cookie->fetch; my $sessid = $cookies{'CGISESSID'}->value; + my ($auth_status) = check_cookie_auth($sessid, $needed_flags); +if( $auth_status ne 'ok' ) { + print CGI::header( '-status' => '401' ); + exit 0; +} + my $borrowernumber = C4::Context->userenv->{'number'}; my $patron_image = Koha::Patron::Images->find($borrowernumber); -- 2.20.1