version 4.11, 2019/11/10 14:39:55 |
version 4.14, 2019/11/11 12:46:23 |
|
|
$allow_enscript @enscript_options %enscript_types |
$allow_enscript @enscript_options %enscript_types |
); |
); |
|
|
|
require Compress::Zlib; |
use Cwd qw(abs_path); |
use Cwd qw(abs_path); |
use File::Path qw(rmtree); |
use File::Path qw(rmtree); |
use File::Spec::Functions qw(canonpath catdir catfile curdir devnull rootdir |
use File::Spec::Functions qw(canonpath catdir catfile curdir devnull rootdir |
Line 102 use constant CVSWEBMARKUP => qr{^text/(x-cvsweb|vnd\.v |
|
Line 103 use constant CVSWEBMARKUP => qr{^text/(x-cvsweb|vnd\.v |
|
use constant LOG_FILESEPR => qr/^={77}$/o; |
use constant LOG_FILESEPR => qr/^={77}$/o; |
use constant LOG_REVSEPR => qr/^-{28}$/o; |
use constant LOG_REVSEPR => qr/^-{28}$/o; |
|
|
use constant HAS_ZLIB => eval { require Compress::Zlib; }; |
|
use constant HAS_EDIFF => eval { require String::Ediff; }; |
use constant HAS_EDIFF => eval { require String::Ediff; }; |
|
|
# ----------------------------------------------------------------------------- |
# ----------------------------------------------------------------------------- |
Line 317 $maycompress = ( |
|
Line 317 $maycompress = ( |
|
&& $ENV{HTTP_ACCEPT_ENCODING} =~ /gzip/) |
&& $ENV{HTTP_ACCEPT_ENCODING} =~ /gzip/) |
|| $is_mozilla3) |
|| $is_mozilla3) |
&& !$is_msie |
&& !$is_msie |
&& !(defined($ENV{MOD_PERL}) && !HAS_ZLIB) |
&& !(defined($ENV{MOD_PERL})) |
); |
); |
|
|
# Parameters that will be sticky in all constructed links/query strings. |
# Parameters that will be sticky in all constructed links/query strings. |
Line 365 if (defined($ENV{QUERY_STRING})) { |
|
Line 365 if (defined($ENV{QUERY_STRING})) { |
|
$val = uri_unescape($val); |
$val = uri_unescape($val); |
$val =~ /([^a-zA-Z_01-9.\/-])/ and fatal('404 Not Found', |
$val =~ /([^a-zA-Z_01-9.\/-])/ and fatal('404 Not Found', |
'Invalid character "%s" in the value "%s" of the query parameter "%s"', |
'Invalid character "%s" in the value "%s" of the query parameter "%s"', |
$1, $value, $key); |
$1, $val, $key); |
} else { |
} else { |
$val = 1; |
$val = 1; |
} |
} |
|
|
<legend>General options</legend> |
<legend>General options</legend> |
<input type="hidden" name="copt" value="1" /> |
<input type="hidden" name="copt" value="1" /> |
EOF |
EOF |
for my $v qw(hidecvsroot hidenonreadable) { |
for my $v (qw(hidecvsroot hidenonreadable)) { |
printf(qq{<input type="hidden" name="%s" value="%s" />\n}, |
printf(qq{<input type="hidden" name="%s" value="%s" />\n}, |
$v, $input{$v} || 0); |
$v, $input{$v} || 0); |
} |
} |
Line 4247 sub http_header(;$$) |
|
Line 4247 sub http_header(;$$) |
|
"img-src 'self'; style-src 'unsafe-inline'"); |
"img-src 'self'; style-src 'unsafe-inline'"); |
|
|
if ($allow_compress && $maycompress) { |
if ($allow_compress && $maycompress) { |
if (HAS_ZLIB |
|
|| (defined($CMD{gzip}) && open(GZIP, "| $CMD{gzip} -1 -c"))) |
|
{ |
|
|
|
push(@headers, 'Content-Encoding: gzip'); |
push(@headers, 'Content-Encoding: gzip'); |
push(@headers, 'Vary: Accept-Encoding'); # RFC 2616, 14.44 |
push(@headers, 'Vary: Accept-Encoding'); # RFC 2616, 14.44 |
print join("\r\n", @headers) . "\r\n\r\n"; |
print join("\r\n", @headers) . "\r\n\r\n"; |
Line 4258 sub http_header(;$$) |
|
Line 4254 sub http_header(;$$) |
|
$| = 1; |
$| = 1; |
$| = 0; # Flush header output. |
$| = 0; # Flush header output. |
|
|
tie(*GZIP, __PACKAGE__, \*STDOUT) if HAS_ZLIB; |
tie(*GZIP, __PACKAGE__, \*STDOUT); |
select(GZIP); |
select(GZIP); |
$gzip_open = 1; |
$gzip_open = 1; |
|
|
} else { |
|
|
|
print join("\r\n", @headers) . "\r\n\r\n"; |
|
printf |
|
'<span style="font-size: smaller">Unable to find gzip binary in the <b>$command_path</b> (<code>%s</code>) to compress output</span><br />', |
|
htmlquote(join(':', @command_path)); |
|
} |
|
|
|
} else { |
} else { |
print join("\r\n", @headers) . "\r\n\r\n"; |
print join("\r\n", @headers) . "\r\n\r\n"; |
} |
} |
|
|
crc => 0, |
crc => 0, |
len => 0, |
len => 0, |
}; |
}; |
my ($header) = pack("c10", |
my ($header) = pack("C10", |
MAGIC1, MAGIC2, Compress::Zlib::Z_DEFLATED(), |
MAGIC1, MAGIC2, Compress::Zlib::Z_DEFLATED(), |
0, 0, 0, 0, 0, 0, OSCODE); |
0, 0, 0, 0, 0, 0, OSCODE); |
print {$o->{handle}} $header; |
print {$o->{handle}} $header; |