Bug 18704 - File types limit in tools/export.pl is causing issues with csv files generated by MS/Excel

To test:
1 - Save a csv of biblionumber from MS/Excel
2 - Attempt to export records using this file
3 - It fails (mimetype is appliction/vnd.ms-excel)
4 - Apply patch
5 - Try again
6 - It succeeds!

Signed-off-by: Jason Palmer <jpalmer@switchinc.org>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Nick Clemens 2017-05-30 16:55:19 -04:00 committed by Jonathan Druart
parent cc54b596c3
commit ef6211b319

View file

@ -74,7 +74,7 @@ if ( $op eq 'export' ) {
my $filename = $query->param('id_list_file');
if ( $filename ) {
my $mimetype = $query->uploadInfo($filename)->{'Content-Type'};
my @valid_mimetypes = qw( application/octet-stream text/csv text/plain );
my @valid_mimetypes = qw( application/octet-stream text/csv text/plain application/vnd.ms-excel );
unless ( grep { /^$mimetype$/ } @valid_mimetypes ) {
push @messages, { type => 'alert', code => 'invalid_mimetype' };
$op = '';