Skip to content

Commit cb3f06a

Browse files
Merge pull request #94 from ericvaandering/port_htaccess
Apply parts of missed commit from 2012
2 parents c2f0f79 + 2e43408 commit cb3f06a

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

DocDB/cgi/FileUtilities.pm

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,6 @@ sub StreamFile (%) {
200200

201201
my @Parts = split /\//,$File;
202202
my $ShortFile = pop @Parts;
203-
select STDOUT;
204-
$| = 1;
205203

206204
my $AttachmentString = "";
207205
if (defined($Preferences{Options}{FileEndingsForAttachment})) {
@@ -216,6 +214,9 @@ sub StreamFile (%) {
216214
"Content-Disposition: $AttachmentString filename=\"$ShortFile\"\n",
217215
"Content-Length: $Size\n\n";
218216

217+
select STDOUT;
218+
$| = 1;
219+
219220
open OUT, "<$File" or die "Cannot open File\n";
220221
binmode OUT if -B $File;
221222
my $BlockSize = (stat OUT)[11] || 16384;

DocDB/cgi/RetrieveArchive

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,17 +113,17 @@ unless (@ErrorStack) {
113113

114114
if ($Type eq "tar.gz") {
115115
if ($GTar) {
116-
$Status = system("$GTar czf $TmpFile -C $Directory .");
116+
$Status = system("$GTar czf $TmpFile --exclude='.htaccess' -C $Directory .");
117117
}
118118
elsif ($Tar && $GZip) {
119-
$Status = system("$Tar cf - $Directory | $GZip > $TmpFile");
119+
$Status = system("$Tar cf - --exclude='.htaccess' $Directory | $GZip > $TmpFile");
120120
}
121121
}
122122
elsif ($Type eq "tar") {
123-
$Status = system("$Tar cf $TmpFile $Directory");
123+
$Status = system("$Tar cf --exclude='.htaccess' $TmpFile $Directory");
124124
}
125125
elsif ($Type eq "zip") {
126-
$Status = system("$Zip $TmpFile $Directory/*");
126+
$Status = system("$Zip $TmpFile $Directory/* -x .htaccess ");
127127
}
128128
if ($Status) {
129129
push @ErrorStack, "There was a problem creating the archive. Please contact an administrator.";

0 commit comments

Comments
 (0)