version 4.5, 2019/11/09 09:24:13 |
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 113 use constant HAS_EDIFF => eval { require String::Ed |
|
Line 113 use constant HAS_EDIFF => eval { require String::Ed |
|
|
|
BEGIN |
BEGIN |
{ |
{ |
$VERSION = '3.0.6'; |
$VERSION = '3.1'; |
|
|
$HTML_DOCTYPE = |
$HTML_DOCTYPE = |
'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ' . |
'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ' . |
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 358 if (defined($ENV{QUERY_STRING})) { |
|
Line 358 if (defined($ENV{QUERY_STRING})) { |
|
$p =~ y/+/ /; |
$p =~ y/+/ /; |
my ($key, $val) = split(/=/, $p, 2); |
my ($key, $val) = split(/=/, $p, 2); |
next unless defined($key); |
next unless defined($key); |
$val = 1 unless defined($val); |
$key = uri_unescape($key); |
($key = uri_unescape($key)) =~ /[[:graph:]]/ or next; |
$key =~ /([^a-z_12-])/ and fatal('404 Not Found', |
($val = uri_unescape($val)) =~ /[[:graph:]]/ or next; |
'Invalid character "%s" in query parameter "%s"', $1, $key); |
|
if (defined $val) { |
|
$val = uri_unescape($val); |
|
$val =~ /([^a-zA-Z_01-9.\/-])/ and fatal('404 Not Found', |
|
'Invalid character "%s" in the value "%s" of the query parameter "%s"', |
|
$1, $val, $key); |
|
} else { |
|
$val = 1; |
|
} |
$query{$key} = $val; |
$query{$key} = $val; |
} |
} |
} |
} |
Line 757 if ($input{tarball}) { |
|
Line 765 if ($input{tarball}) { |
|
} |
} |
|
|
# Clean up. |
# Clean up. |
|
chdir(".."); |
rmtree($tmpexportdir); |
rmtree($tmpexportdir); |
|
|
&fatal(@fatal) if @fatal; |
&fatal(@fatal) if @fatal; |
|
|
<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 1540 sub htmlify($;$) |
|
Line 1549 sub htmlify($;$) |
|
}{ |
}{ |
my($text, $name, $section) = ($1, $2, defined($3) ? $3 : $4); |
my($text, $name, $section) = ($1, $2, defined($3) ? $3 : $4); |
($name =~ /[A-Za-z]/ && $name !~ /\.(:|$)/) |
($name =~ /[A-Za-z]/ && $name !~ /\.(:|$)/) |
? &link($text, sprintf($mancgi, $section, uri_escape($name))) |
? &link($text, sprintf($mancgi, uri_escape($name), $section)) |
: $text; |
: $text; |
}egx; |
}egx; |
} $_; |
} $_; |
Line 4194 sub htmlquote($) |
|
Line 4203 sub htmlquote($) |
|
# Special Characters; RFC 1866 |
# Special Characters; RFC 1866 |
s/&/&/g; |
s/&/&/g; |
s/\"/"/g; |
s/\"/"/g; |
|
s/"/"/g; |
s/</</g; |
s/</</g; |
s/>/>/g; |
s/>/>/g; |
return $_; |
return $_; |
Line 4233 sub http_header(;$$) |
|
Line 4243 sub http_header(;$$) |
|
push(@headers, 'Last-Modified: ' . scalar gmtime($moddate) . ' GMT') |
push(@headers, 'Last-Modified: ' . scalar gmtime($moddate) . ' GMT') |
if $moddate; |
if $moddate; |
push(@headers, 'Content-Type: ' . $content_type); |
push(@headers, 'Content-Type: ' . $content_type); |
|
push(@headers, "Content-Security-Policy: default-src 'none'; " . |
|
"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 4246 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; |