Bugzilla – Attachment 170122 Details for
Bug 37370
opac-export.pl can be used even if exporting disabled
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37370: Return 400 if OpacExportOptions does not contain the passed format
Bug-37370-Return-400-if-OpacExportOptions-does-not.patch (text/plain), 1.41 KB, created by
David Cook
on 2024-08-07 01:39:58 UTC
(
hide
)
Description:
Bug 37370: Return 400 if OpacExportOptions does not contain the passed format
Filename:
MIME Type:
Creator:
David Cook
Created:
2024-08-07 01:39:58 UTC
Size:
1.41 KB
patch
obsolete
>From 8684fb83ca19513f38ce8fb027b3aefeaada99a3 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Tue, 16 Jul 2024 12:43:39 -0300 >Subject: [PATCH] Bug 37370: Return 400 if OpacExportOptions does not contain > the passed format > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >Signed-off-by: David Cook <dcook@prosentient.com.au> >--- > opac/opac-export.pl | 10 ++++++++++ > 1 file changed, 10 insertions(+) > >diff --git a/opac/opac-export.pl b/opac/opac-export.pl >index 1b0fdad59a..d0e5bf1203 100755 >--- a/opac/opac-export.pl >+++ b/opac/opac-export.pl >@@ -33,6 +33,8 @@ use C4::Ris qw( marc2ris ); > use Koha::Biblios; > use Koha::RecordProcessor; > >+use List::MoreUtils qw(none); >+ > my $query = CGI->new; > my $op=$query->param("op")||''; #op=export is currently the only use > my $format=$query->param("format")||'utf8'; >@@ -40,6 +42,14 @@ my $biblionumber = $query->param("bib")||0; > $biblionumber = int($biblionumber); > my $error = q{}; > >+my @valid_formats = split( ',', C4::Context->preference('OpacExportOptions') // '' ); >+if ( !scalar @valid_formats || none { $format eq $_ } @valid_formats ) { >+ # bad request: either the feature is disabled, or requested a format the >+ # library hasn't made available >+ print $query->redirect("/cgi-bin/koha/errors/400.pl"); >+ exit; >+} >+ > # Determine logged in user's patron category. > # Blank if not logged in. > my $userenv = C4::Context->userenv; >-- >2.39.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 37370
:
169054
|
170122
|
170133