@@ -, +, @@ --- tools/import_borrowers.pl | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) --- a/tools/import_borrowers.pl +++ a/tools/import_borrowers.pl @@ -58,6 +58,8 @@ use Text::CSV; use CGI; # use encoding 'utf8'; # don't do this +my $tmpdir = '/tmp'; + my (@errors, @feedback); my $extended = C4::Context->preference('ExtendedPatronAttributes'); my $set_messaging_prefs = C4::Context->preference('EnhancedMessagingPreferences'); @@ -96,7 +98,9 @@ if ($input->param('report')) { -type => 'text/plain', -attachment => 'import_borrowers_report.txt' ); - open my $fh, '<', $input->param('errors_filename'); + my $filename = $input->param('errors_filename'); + $filename =~ s/\.\.//g; + open my $fh, '<', $tmpdir . '/' . $filename; print $fh; close $fh; #TODO : We surely want to check that is it really a temp file that we are unlinking @@ -366,7 +370,8 @@ if ( $uploadborrowers && length($uploadborrowers) > 0 ) { print $tmpf $output; $template->param( download_errors => 1, - errors_filename => $tmpf->filename + errors_filename => $tmpf->filename, + DIR => $tmpdir, ); close $tmpf; } --