W3C home > Mailing lists > Public > www-validator-cvs@w3.org > June 2009

validator/httpd/cgi-bin check,1.661,1.662 sendfeedback.pl,1.10,1.11

From: Ville Skytta via cvs-syncmail <cvsmail@w3.org>
Date: Mon, 29 Jun 2009 14:33:40 +0000
To: www-validator-cvs@w3.org
Message-Id: <E1MLHvR-0006HR-06@lionel-hutz.w3.org>
Update of /sources/public/validator/httpd/cgi-bin
In directory hutz:/tmp/cvs-serv24058/httpd/cgi-bin

Modified Files:
	check sendfeedback.pl 
Log Message:
Drop Config::General <= 2.31 workarounds, require >= 2.32.

Index: sendfeedback.pl
===================================================================
RCS file: /sources/public/validator/httpd/cgi-bin/sendfeedback.pl,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- sendfeedback.pl	4 Jan 2009 16:54:19 -0000	1.10
+++ sendfeedback.pl	29 Jun 2009 14:33:38 -0000	1.11
@@ -13,9 +13,9 @@
 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 $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 @@
     $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 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.'"';

Index: check
===================================================================
RCS file: /sources/public/validator/httpd/cgi-bin/check,v
retrieving revision 1.661
retrieving revision 1.662
diff -u -d -r1.661 -r1.662
--- check	26 Jun 2009 21:15:06 -0000	1.661
+++ check	29 Jun 2009 14:33:38 -0000	1.662
@@ -46,7 +46,7 @@
 
 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 @@
 
 #
 # 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
@@ -207,21 +207,12 @@
   $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 @@
       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 @@
           $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/;
           }
Received on Monday, 29 June 2009 14:33:54 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:17:36 UTC