diff --git a/opac/opac-downloadcart.pl b/opac/opac-downloadcart.pl index 7720cd461e..0fb7a02f3c 100755 --- a/opac/opac-downloadcart.pl +++ b/opac/opac-downloadcart.pl @@ -66,6 +66,12 @@ if ($bib_list && $format) { # CSV if ($format =~ /^\d+$/) { + my $csv_profile = Koha::CsvProfiles->find($format); + if ( not $csv_profile or $csv_profile->staff_only ) { + print $query->redirect('/cgi-bin/koha/errors/404.pl'); + exit; + } + $output = marc2csv(\@bibs, $format); # Other formats diff --git a/opac/opac-downloadshelf.pl b/opac/opac-downloadshelf.pl index f317f3ca3d..011fd0c5c5 100755 --- a/opac/opac-downloadshelf.pl +++ b/opac/opac-downloadshelf.pl @@ -75,6 +75,13 @@ if ( $shelf and $shelf->can_be_viewed( $borrowernumber ) ) { # CSV if ($format =~ /^\d+$/) { + + my $csv_profile = Koha::CsvProfiles->find($format); + if ( not $csv_profile or $csv_profile->staff_only ) { + print $query->redirect('/cgi-bin/koha/errors/404.pl'); + exit; + } + my @biblios; while ( my $content = $contents->next ) { push @biblios, $content->biblionumber;