From 283fd8cf237c6f75e1209d48b0186d82c85f51cf Mon Sep 17 00:00:00 2001 From: Julian Maurice Date: Tue, 19 Mar 2013 11:24:16 +0000 Subject: [PATCH] Bug 6874: Follow-up for PBP fixes --- cataloguing/value_builder/upload.pl | 2 +- opac/opac-retrieve-file.pl | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cataloguing/value_builder/upload.pl b/cataloguing/value_builder/upload.pl index 0cb33f4..03ad77b 100755 --- a/cataloguing/value_builder/upload.pl +++ b/cataloguing/value_builder/upload.pl @@ -140,7 +140,7 @@ sub finddirs { my $base = shift || $upload_path; my $found = 0; my @dirs; - my @files = <$base/*>; + my @files = glob("$base/*"); foreach (@files) { if (-d $_ and -w $_) { my $lastdirname = basename($_); diff --git a/opac/opac-retrieve-file.pl b/opac/opac-retrieve-file.pl index ddbf1ac..d5406e6 100755 --- a/opac/opac-retrieve-file.pl +++ b/opac/opac-retrieve-file.pl @@ -32,12 +32,12 @@ exit 1 if not $file; my $file_path = $file->{filepath}; if( -f $file_path ) { - open FH, '<', $file_path or die "Can't open file: $!"; + open my $fh, '<', $file_path or die "Can't open file: $!"; print $input->header( -type => "application/octet-stream", -attachment => $file->{filename} ); - while() { + while(<$fh>) { print $_; } } else { -- 1.7.2.5