summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xhtdocs/docs/install.html6
-rwxr-xr-xhttpd/cgi-bin/check31
-rwxr-xr-xhttpd/cgi-bin/sendfeedback.pl23
-rw-r--r--misc/bundle/META.yml2
-rw-r--r--misc/bundle/Makefile.PL2
-rw-r--r--misc/bundle/lib/Bundle/W3C/Validator.pm2
-rwxr-xr-xmisc/docs_errors.pl40
7 files changed, 39 insertions, 67 deletions
diff --git a/htdocs/docs/install.html b/htdocs/docs/install.html
index cdf9526..0c78556 100755
--- a/htdocs/docs/install.html
+++ b/htdocs/docs/install.html
@@ -1,5 +1,5 @@
-<!--#set var="revision" value="\$Id: install.html,v 1.50 2009-06-23 18:27:39 ville Exp $"
---><!--#set var="date" value="\$Date: 2009-06-23 18:27:39 $"
+<!--#set var="revision" value="\$Id: install.html,v 1.51 2009-06-29 14:33:38 ville Exp $"
+--><!--#set var="date" value="\$Date: 2009-06-29 14:33:38 $"
--><!--#set var="title" value="Installation Documentation for The W3C Markup Validation Service"
--><!--#set var="relroot" value="../"
--><!--#include virtual="../header.html" -->
@@ -128,7 +128,7 @@ install Bundle::W3C::Validator
takes care of all those niggly little bits of CGI for us and make
options parsing and file upload a breeze.
</dd>
- <dt><a href="http://search.cpan.org/dist/Config-General/">Config-General</a> &gt;= 2.31</dt>
+ <dt><a href="http://search.cpan.org/dist/Config-General/">Config-General</a> &gt;= 2.32</dt>
<dd>
Configuration file handling.
</dd>
diff --git a/httpd/cgi-bin/check b/httpd/cgi-bin/check
index 2bdb89e..37ebd16 100755
--- a/httpd/cgi-bin/check
+++ b/httpd/cgi-bin/check
@@ -14,7 +14,7 @@
# This source code is available under the license at:
# http://www.w3.org/Consortium/Legal/copyright-software
#
-# $Id: check,v 1.661 2009-06-26 21:15:06 ville Exp $
+# $Id: check,v 1.662 2009-06-29 14:33:38 ville Exp $
#
# Disable buffering on STDOUT!
$| = 1;
@@ -46,7 +46,7 @@ package W3C::Validator::MarkupValidator;
use CGI 2.81 qw(-newstyle_urls -private_tempfiles redirect);
use CGI::Carp qw(carp croak fatalsToBrowser);
-use Config::General 2.31 qw(); # Need 2.31 for (partial) <msg 0> sanity
+use Config::General 2.32 qw(); # Need 2.32 for <msg 0>, rt.cpan.org#17852
use Encode qw();
use Encode::Alias qw();
use Encode::HanExtra qw(); # for some chinese character encodings,
@@ -88,7 +88,7 @@ use constant O_NONE => 8; # 0000 1000
#
# Define global variables.
-use vars qw($DEBUG $CFG $RSRC $VERSION);
+use vars qw($DEBUG $CFG %RSRC $VERSION);
#
# Things inside BEGIN don't happen on every request in persistent environments
@@ -199,7 +199,7 @@ Directory not readable (permission denied): @_r
#
# Strings
- $VERSION = q$Revision: 1.661 $;
+ $VERSION = q$Revision: 1.662 $;
$VERSION =~ s/Revision: ([\d\.]+) /$1/;
#
@@ -207,21 +207,12 @@ Directory not readable (permission denied): @_r
$ENV{FTP_PASSIVE} = 1 unless exists($ENV{FTP_PASSIVE});
# Read friendly error message file
- my %rsrc = Config::General->new(
+ # 'en_US' should be replaced by $lang for lang-neg
+ %RSRC = Config::General->new(
-MergeDuplicateBlocks => 1,
-ConfigFile => catfile($CFG->{Paths}->{Templates}, 'en_US',
'error_messages.cfg'),
)->getall();
- # 'en_US' should be replaced by $lang for lang-neg
- # Config::General 2.31 workaround for <msg 0> issues:
- # http://lists.w3.org/Archives/Public/public-qa-dev/2006Feb/0022.html
- # http://lists.w3.org/Archives/Public/public-qa-dev/2006Feb/0025.html
- # https://rt.cpan.org/Public/Bug/Display.html?id=17852
- $rsrc{msg}{0} ||=
- { original => delete($rsrc{msg}{original}),
- verbose => delete($rsrc{msg}{verbose}),
- };
- $RSRC = \%rsrc;
eval {
local $SIG{__DIE__};
@@ -2120,10 +2111,10 @@ sub report_errors ($) {
else {
if ($err->{num}) {
my $num = $err->{num};
- $explanation .= Encode::decode_utf8("\n $RSRC->{msg}->{$num}->{verbose}\n")
- if exists $RSRC->{msg}->{$num}
- && exists $RSRC->{msg}->{$num}->{verbose};
- my $_msg = $RSRC->{msg}->{nomsg}->{verbose};
+ $explanation .= Encode::decode_utf8("\n $RSRC{msg}->{$num}->{verbose}\n")
+ if exists $RSRC{msg}->{$num}
+ && exists $RSRC{msg}->{$num}->{verbose};
+ my $_msg = $RSRC{msg}->{nomsg}->{verbose};
$_msg =~ s/<!--MID-->/$num/g;
if (($File->{'Is Upload'}) or ($File->{'Direct Input'}))
{
@@ -2176,7 +2167,7 @@ sub report_errors ($) {
$Errors_bytype{$err->{num}}->{instances} = [];
my $msg_text;
if ($err->{num} ne 'xmlwf') {
- $msg_text = $RSRC->{msg}->{$err->{num}}->{original};
+ $msg_text = $RSRC{msg}->{$err->{num}}->{original};
$msg_text =~ s/%1/X/;
$msg_text =~ s/%2/Y/;
}
diff --git a/httpd/cgi-bin/sendfeedback.pl b/httpd/cgi-bin/sendfeedback.pl
index 6936aaf..ce8d7df 100755
--- a/httpd/cgi-bin/sendfeedback.pl
+++ b/httpd/cgi-bin/sendfeedback.pl
@@ -1,7 +1,7 @@
#!/usr/bin/perl -T
##
## feedback generator for W3C Markup Validation Service
-# # $Id: sendfeedback.pl,v 1.10 2009-01-04 16:54:19 ville Exp $
+# # $Id: sendfeedback.pl,v 1.11 2009-06-29 14:33:38 ville Exp $
## Pragmas.
use strict;
@@ -13,9 +13,9 @@ use warnings;
use CGI qw();
use File::Spec::Functions qw(catfile);
use HTML::Template 2.6 qw();
-use Config::General 2.31 qw(); # Need 2.31 for (partial) <msg 0> sanity
+use Config::General 2.32 qw(); # Need 2.32 for <msg 0>, rt.cpan.org#17852
-use vars qw($DEBUG $CFG $RSRC $VERSION $HAVE_IPC_RUN);
+use vars qw($DEBUG $CFG %RSRC $VERSION $HAVE_IPC_RUN);
# Define global constants
use constant TRUE => 1;
use constant FALSE => 0;
@@ -68,20 +68,11 @@ our $q = new CGI;
our $lang = 'en_US'; # @@@ TODO: conneg
# Read error message + explanations file
-our %rsrc = Config::General->new(
+%RSRC = Config::General->new(
-MergeDuplicateBlocks => 1,
-ConfigFile => catfile($CFG->{Paths}->{Templates}, $lang,
'error_messages.cfg'),
)->getall();
-# Config::General 2.31 workaround for <msg 0> issues:
-# http://lists.w3.org/Archives/Public/public-qa-dev/2006Feb/0022.html
-# http://lists.w3.org/Archives/Public/public-qa-dev/2006Feb/0025.html
-# https://rt.cpan.org/Public/Bug/Display.html?id=17852
-$rsrc{msg}{0} ||=
- { original => delete($rsrc{msg}{original}),
- verbose => delete($rsrc{msg}{verbose}),
- };
-$RSRC = \%rsrc;
our $T = HTML::Template->new(
filename => catfile($CFG->{Paths}->{Templates}, $lang, 'feedback.tmpl'),
@@ -97,7 +88,7 @@ sub process_query {
$validated_uri = $q->param('uri');
$errmsg_id = $q->param('errmsg_id');
if ($errmsg_id) {
- $errmsg_text = "$RSRC->{msg}->{$errmsg_id}->{original}";
+ $errmsg_text = "$RSRC{msg}->{$errmsg_id}->{original}";
$errmsg_text = de_template_explanation($errmsg_text);
}
# Trigger "thanks for your message. If your query requires an answer,..." ack paragraph
@@ -114,12 +105,12 @@ sub send_message {
sub error_choices {
# creates drop-down menu with all possible error messages to send feedback about
- my @msgnumbers = keys( %{$RSRC->{msg}} );
+ my @msgnumbers = keys( %{$RSRC{msg}} );
@msgnumbers = sort { $a <=> $b } @msgnumbers;
my $errlabel;
for my $errnum ( @msgnumbers ) {
- $errlabel = $RSRC->{msg}->{$errnum}->{original};
+ $errlabel = $RSRC{msg}->{$errnum}->{original};
$errlabel = de_template_explanation($errlabel);
if (length($errlabel) > 70) { $errlabel = substr($errlabel, 0, 67)."..." }
$errlist = $errlist.'<option value="'. $errnum.'"';
diff --git a/misc/bundle/META.yml b/misc/bundle/META.yml
index dd9c9c9..33af029 100644
--- a/misc/bundle/META.yml
+++ b/misc/bundle/META.yml
@@ -10,7 +10,7 @@ distribution_type: module
requires:
CGI: 2.81
CGI::Carp: 0
- Config::General: 2.31
+ Config::General: 2.32
Encode: 0
Encode::Alias: 0
Encode::HanExtra: 0
diff --git a/misc/bundle/Makefile.PL b/misc/bundle/Makefile.PL
index 0e867ae..dba2238 100644
--- a/misc/bundle/Makefile.PL
+++ b/misc/bundle/Makefile.PL
@@ -11,7 +11,7 @@ WriteMakefile(
# Hard dependencies:
CGI => 2.81,
CGI::Carp => 0,
- Config::General => 2.31,
+ Config::General => 2.32,
Encode => 0,
Encode::Alias => 0,
Encode::HanExtra => 0,
diff --git a/misc/bundle/lib/Bundle/W3C/Validator.pm b/misc/bundle/lib/Bundle/W3C/Validator.pm
index 348fc66..bc39368 100644
--- a/misc/bundle/lib/Bundle/W3C/Validator.pm
+++ b/misc/bundle/lib/Bundle/W3C/Validator.pm
@@ -22,7 +22,7 @@ C<perl -MCPAN -e "install Bundle::W3C::Validator">
CGI 2.81
CGI::Carp
- Config::General 2.31
+ Config::General 2.32
Encode
Encode::Alias
Encode::HanExtra
diff --git a/misc/docs_errors.pl b/misc/docs_errors.pl
index 178101f..793cc1d 100755
--- a/misc/docs_errors.pl
+++ b/misc/docs_errors.pl
@@ -2,7 +2,7 @@
##
## Generates HTML documentation of error messages and explanations
## for W3C Markup Validation Service
-## $Id: docs_errors.pl,v 1.8 2009-01-04 10:41:20 ville Exp $
+## $Id: docs_errors.pl,v 1.9 2009-06-29 14:33:39 ville Exp $
## Pragmas.
use strict;
@@ -13,9 +13,9 @@ use warnings;
use File::Spec::Functions qw(catfile);
use HTML::Template 2.6 qw();
-use Config::General 2.19 qw(); # Need 2.19 for -AutoLaunder
+use Config::General 2.32 qw(); # Need 2.32 for <msg 0>, rt.cpan.org#17852
-use vars qw($DEBUG $CFG $RSRC $VERSION $HAVE_IPC_RUN);
+use vars qw($DEBUG $CFG $VERSION $HAVE_IPC_RUN);
# Define global constants
use constant TRUE => 1;
use constant FALSE => 0;
@@ -69,16 +69,6 @@ our $error_messages_file = catfile($CFG->{Paths}->{Templates}, $lang, 'error_mes
our %config_errs = ( -MergeDuplicateBlocks => 1,
-ConfigFile => $error_messages_file);
our %rsrc = Config::General->new(%config_errs)->getall();
-# Config::General workarounds for <msg 0> issues:
-# http://lists.w3.org/Archives/Public/public-qa-dev/2006Feb/0022.html
-# http://lists.w3.org/Archives/Public/public-qa-dev/2006Feb/0025.html
-# https://rt.cpan.org/Public/Bug/Display.html?id=17852
-$rsrc{msg}{0} ||=
- delete($rsrc{'msg 0'}) || # < 2.31
- { original => delete($rsrc{msg}{original}), # 2.31
- verbose => delete($rsrc{msg}{verbose}),
- };
-$RSRC = \%rsrc;
our $T = HTML::Template->new(
@@ -86,28 +76,28 @@ our $T = HTML::Template->new(
die_on_bad_params => FALSE,
);
-$T->param(list_errors_hasverbose => &list_errors_hasverbose($RSRC));
-$T->param(list_errors_noverbose => &list_errors_noverbose($RSRC));
+$T->param(list_errors_hasverbose => &list_errors_hasverbose(\%rsrc));
+$T->param(list_errors_noverbose => &list_errors_noverbose(\%rsrc));
print $T->output;
sub list_errors_hasverbose{
- my $RSRC = shift;
+ my $rsrc = shift;
my $errors = [];
my $error_id;
my $max_error_id=500; # where to stop
for ($error_id=0;$error_id<$max_error_id;$error_id++)
{
my %single_error;
- if ($RSRC->{msg}->{$error_id})
+ if ($rsrc->{msg}->{$error_id})
{
- my $verbose = $RSRC->{msg}->{$error_id}->{verbose};
+ my $verbose = $rsrc->{msg}->{$error_id}->{verbose};
if ($verbose)
{
- my $original = $RSRC->{msg}->{$error_id}->{original};
+ my $original = $rsrc->{msg}->{$error_id}->{original};
$original = &de_template_explanation($original);
$single_error{original} = $original;
$single_error{id} = $error_id;
- $single_error{verbose} = $RSRC->{msg}->{$error_id}->{verbose};
+ $single_error{verbose} = $rsrc->{msg}->{$error_id}->{verbose};
$single_error{verbose} =~ s/<!--CFG_HOME_PAGE-->/$CFG->{'Home Page'}/g;
push @{$errors}, \%single_error;
@@ -122,23 +112,23 @@ sub list_errors_hasverbose{
}
sub list_errors_noverbose{
- my $RSRC = shift;
+ my $rsrc = shift;
my $errors = [];
my $error_id;
my $max_error_id=500; # where to stop
for ($error_id=0;$error_id<$max_error_id;$error_id++)
{
my %single_error;
- if ($RSRC->{msg}->{$error_id})
+ if ($rsrc->{msg}->{$error_id})
{
- my $verbose = $RSRC->{msg}->{$error_id}->{verbose};
+ my $verbose = $rsrc->{msg}->{$error_id}->{verbose};
if (! $verbose)
{
- my $original = $RSRC->{msg}->{$error_id}->{original};
+ my $original = $rsrc->{msg}->{$error_id}->{original};
$original = &de_template_explanation($original);
$single_error{original} = $original;
$single_error{id} = $error_id;
- $single_error{verbose} = $RSRC->{msg}->{$error_id}->{verbose};
+ $single_error{verbose} = $rsrc->{msg}->{$error_id}->{verbose};
push @{$errors}, \%single_error;
}