diff -Naru validator.protocol/httpd/cgi-bin/check validator/httpd/cgi-bin/check --- validator.protocol/httpd/cgi-bin/check Sat Oct 6 22:12:28 2001 +++ validator/httpd/cgi-bin/check Sat Oct 6 22:13:58 2001 @@ -22,7 +22,8 @@ use LWP::UserAgent (); use URI (); use CGI::Carp (); -use CGI qw(:cgi -newstyle_urls -private_tempfiles); +# @@ Need 2.78 for XHTML. 2.78 does broken default values with popup_menu still +use CGI 2.78 qw(-newstyle_urls -private_tempfiles); use Text::Wrap (); use Text::Iconv (); # on debian: apt-get install libtext-iconv-perl use HTML::Parser 3.25 (); # Need 3.25 for $p->ignore_elements. @@ -102,12 +103,9 @@ $NOTICE = ''; # "

Note: This service will be ..."; # -# DOCTYPEs -my $html32_doctype = q(); -my $html40s_doctype = q(); -my $html40t_doctype = q(); -my $html40f_doctype = q(); -my $xhtmlt_doctype = q(); +my $html_start = q(); # # Read configuration files. @@ -196,13 +194,14 @@ # We save it in a string instead of printing it in case we need to abort before # we have any meaningfull results to report. @@ May not be necessary! $File->{Results} = <<"EOF"; +Content-Language: en Content-Type: text/html; charset=utf-8 -$html40t_doctype - +$html_doctype +$html_start W3C HTML Validation Service Results - + @@ -260,7 +259,7 @@ URIs should be in the form:

- http://validator.w3.org/ +

http://validator.w3.org/

EOF &clean_up_and_exit; @@ -477,7 +476,7 @@ To assure correct validation, processing, and display, it is important that the character encoding is properly labeled. - Further + Further explanations. EOHD $File->{Tentative} |= T_DEBUG; # WOuld be T_WARN, but the complaints... @@ -638,25 +637,25 @@ &add_warning ("Unknown namespace («$File->{Namespace}») for text/html document!"); if ($File->{Namespace} ne '') { &add_table("Root Namespace", - "$File->{Namespace}"); + "{Namespace}\">$File->{Namespace}"); } } elsif ($File->{Type} eq 'svg' and $File->{Namespace} ne 'http://www.w3.org/2000/svg') { &add_warning ("Unknown namespace («$File->{Namespace}») for SVG document!"); if ($File->{Namespace} ne '') { &add_table("Root Namespace", - "$File->{Namespace}"); + "{Namespace}\">$File->{Namespace}"); } } else { if ($File->{Namespace} ne '') { &add_table("Root Namespace", - "$File->{Namespace}"); + "{Namespace}\">$File->{Namespace}"); } } if (scalar keys %{$File->{Namespaces}} > 1) { my $namespaces = ""); @@ -767,24 +766,24 @@ my $tableEntry; unless ($q->param('uploaded_file')) { add_table("Options", - ' \n" . - ' \n" . - ' \n" . - ' \n" ); } - print "
\n"; + print "
\n"; for $tableEntry (@{$File->{Table}}) { print " \n"; print ' ' x 6, "\n"; - print ' ' x 6, "\n"; + print ' ' x 6, "\n"; print " \n"; } - print " \n"; + print " \n"; print "
", $$tableEntry{Head}, ": ", $$tableEntry{Tail}, "", $$tableEntry{Tail}, "
 
\n"; } @@ -832,9 +831,9 @@ print <<"EOF";
Valid HTML 4.01! - Gerald Oskoboiny
+ src="${abs_svc_uri}images/vxhtml10" height="31" width="88" + align="right" border="0" alt="Valid XHTML 1.0!" /> + Gerald Oskoboiny
Last modified: $DATE
@@ -850,7 +849,7 @@ sub internal_error { my ($dieMessage) = shift; print <<"EOF"; -
+
Internal server error ($dieMessage). Please contact maintainer. EOF @@ -883,11 +882,20 @@ sub redirect_to_home_page { print <<".EOF."; Status: 301 Moved Permanently -Content-Type: text/html +Content-Language: en +Content-Type: text/html; charset=utf-8 Location: $abs_svc_uri -Moved! -

Please see the home page.

+$html_doctype +$html_start + + Moved! + + + + + +

Please see the home page.

.EOF. &clean_up_and_exit; } @@ -947,73 +955,78 @@ Status: 401 Authorization Required WWW-Authenticate: $authHeader Connection: close -Content-Type: text/html +Content-Language: en +Content-Type: text/html; charset=utf-8 - - -401 Authorization Required - -

Authorization Required

-

- Sorry, I am not authorized to access the specified URI. -

- -

- The URI you specified, -

- -
- $resource -
- -

- returned a 401 "authorization required" response when I tried - to download it. -

- -

- You should have been prompted by your browser for a - username/password pair; if you had supplied this information, I - would have forwarded it to your server for authorization to - access the resource. You can use your browser's "reload" function - to try again, if you wish. -

- -

- Of course, you may not want to trust me with this information, - which is fine. I can tell you that I don't log it or do - anything else nasty with it, and you can download the source for - this service to see what it does, but you have no guarantee - that this is actually the code I'm using; you basically have to - decide whether to trust me or not. :-) -

- -

- You should also be aware that the way we proxy this authentication - information defeats the normal working of HTTP Authentication. - If you authenticate to server A, your browser may keep sending - the authentication information to us every time you validate - a page, regardless of what server it's on, and we'll happily pass - that on to the server thereby making it possible for a malicious - server operator to capture your credentials. -

- -

- Due to the way HTTP Authentication works there is no way we can - avoid this. We are using some "tricks" to fool your client into - not sending this information in the first place, but there is no - guarantee this will work. If security is a conern to you, you - may wish to avoid validating protected resources or take extra - precautions to prevent your browser from sending authentication - information when validating other servers. -

- -

- Also note that you shouldn't use HTTP Basic Authentication for - anything which really needs to be private, since the password - goes across the network unencrypted. -

+$html_doctype +$html_start + + 401 Authorization Required + + + + + +

Authorization Required

+

+ Sorry, I am not authorized to access the specified URI. +

+ +

+ The URI you specified, +

+ +
+

$resource

+
+ +

+ returned a 401 "authorization required" response when I tried + to download it. +

+

+ You should have been prompted by your browser for a + username/password pair; if you had supplied this information, I + would have forwarded it to your server for authorization to + access the resource. You can use your browser's "reload" function + to try again, if you wish. +

+ +

+ Of course, you may not want to trust me with this information, + which is fine. I can tell you that I don't log it or do + anything else nasty with it, and you can download the source for + this service to see what it does, but you have no guarantee + that this is actually the code I'm using; you basically have to + decide whether to trust me or not. :-) +

+ +

+ You should also be aware that the way we proxy this authentication + information defeats the normal working of HTTP Authentication. + If you authenticate to server A, your browser may keep sending + the authentication information to us every time you validate + a page, regardless of what server it's on, and we'll happily pass + that on to the server thereby making it possible for a malicious + server operator to capture your credentials. +

+ +

+ Due to the way HTTP Authentication works there is no way we can + avoid this. We are using some "tricks" to fool your client into + not sending this information in the first place, but there is no + guarantee this will work. If security is a conern to you, you + may wish to avoid validating protected resources or take extra + precautions to prevent your browser from sending authentication + information when validating other servers. +

+ +

+ Also note that you shouldn't use HTTP Basic Authentication for + anything which really needs to be private, since the password + goes across the network unencrypted. +

EOF } @@ -1032,7 +1045,7 @@

- $code $message +

$code $message

@@ -1419,20 +1432,21 @@ or $err->{msg} =~ m(unrecognized ({{)?DOCTYPE(}})?)i or $err->{msg} =~ m(no document type declaration)i) { print <<" .EOF."; -

Fatal Error: $err->{msg}

+
  • Fatal Error: $err->{msg}

    I could not parse this document, because it uses a public identifier that is not in my catalog.

    .EOF. &output_doctype_spiel; + print "
  • "; last; } # No or unknown FPI and a relative SI. if ($err->{msg} =~ m(cannot (open|find))) { print <<" .EOF."; -

    Fatal Error: $err->{msg}

    +
  • Fatal Error: $err->{msg}

    I could not parse this document, because it makes reference to a system-specific file instead of using a well-known public identifier to @@ -1440,6 +1454,7 @@

    .EOF. &output_doctype_spiel; + print "
  • "; last; } @@ -1469,13 +1484,13 @@ print qq{ ("$err->{idx}")}; } - print "\n
      $line\n";
    +    print "\n
      $line\n";
         print " " x ($col + 2); # 2 is the number of spaces before  above
         print " " x 4 if $col != $err->{char}; # only for truncated lines
    -    print "^
    \n"; + print "^
    \n"; } print "\n"; - print "
    \n"; + print "
    \n"; if ($version eq 'unknown') { print "

    Sorry, I can't validate this document.

    "; } elsif ($File->{Type} eq 'xml') { @@ -1508,41 +1523,41 @@ $alttext = "Valid HTML 2.0!"; $gifborder = ""; } elsif ($version =~ /HTML 3\.2 Strict$/) { - $image_uri = "http://www.w3.org/Icons/valid-html40"; + $image_uri = "${abs_svc_uri}images/vh40"; $alttext = "Valid HTML 4.0!"; $gifborder = ""; $gifhw = ' height="31" width="88"'; } elsif ($version =~ /HTML 4\.0<\/a> /) { - $image_uri = "http://www.w3.org/Icons/valid-html40"; + $image_uri = "${abs_svc_uri}images/vh40"; $alttext = "Valid HTML 4.0!"; $gifhw = ' height="31" width="88"'; } elsif ($version =~ /HTML 4\.01<\/a> Strict$/) { - $image_uri = "http://www.w3.org/Icons/valid-html401"; + $image_uri = "${abs_svc_uri}images/vh401"; $alttext = "Valid HTML 4.01!"; $gifborder = ""; $gifhw = ' height="31" width="88"'; } elsif ($version =~ /HTML 4\.01<\/a> /) { - $image_uri = "http://www.w3.org/Icons/valid-html401"; + $image_uri = "${abs_svc_uri}images/vh401"; $alttext = "Valid HTML 4.01!"; $gifhw = ' height="31" width="88"'; } elsif ($version =~ /XHTML 1\.0<\/a> /) { - $image_uri = "http://www.w3.org/Icons/valid-xhtml10"; + $image_uri = "${abs_svc_uri}images/vxhtml10"; $alttext = "Valid XHTML 1.0!"; $gifborder = ""; $gifhw = ' height="31" width="88"'; $xhtmlendtag = " /"; # } elsif ($version =~ /XHTML Basic 1.0/) { -# $image_uri = "${abs_svc_uri}/images/vxhtml-basic10"; +# $image_uri = "${abs_svc_uri}images/vxhtml-basic10"; # $alttext = "Valid XHTML Basic 1.0!"; # $gifborder = ""; # $gifhw = ' height="31" width="88"'; # $xhtmlendtag = " /"; } elsif ($version =~ /XHTML 1.1/) { - $image_uri = "http://www.w3.org/Icons/valid-xhtml11"; + $image_uri = "${abs_svc_uri}images/vxhtml11"; $alttext = "Valid XHTML 1.1!"; $gifborder = ""; $gifhw = ' height="31" width="88"'; @@ -1561,8 +1576,8 @@ if (defined $image_uri) { print <<"EOHD";

    - $alttext Congratulations, this - document validates as $version! + $alttext + Congratulations, this document validates as $version!

    @@ -1617,7 +1632,7 @@

    - $thispage +

    $thispage

    @@ -1642,7 +1657,7 @@ sub weblint { print <<"EOF";

    -
    +

    Weblint Doesnt Live Here Any More

    Weblint is no longer actively @@ -1673,7 +1688,7 @@ print <<'EOF';

    -
    +

    Outline

    Below is an outline for this document, automatically generated from the @@ -1694,7 +1709,7 @@ print " \n" x ($prevlevel - $level); # perl is so cool. if ($level - $prevlevel == 1) {print "

      \n"}; foreach my $i (($prevlevel + 1) .. ($level - 1)) { - print qq(
        \n
      • A level $i heading is missing!\n); + print qq(
          \n
        • A level $i heading is missing!
        • \n); } if ($level - $prevlevel > 1) {print "
            \n"}; @@ -1718,7 +1733,7 @@ $heading = substr($heading, 1); # chop the leading '-' or ' '. $heading = &ent($heading); - print "
          • $heading\n"; + print "
          • $heading
          • \n"; } print "
          \n" x $level; print <<'EOF'; @@ -1741,7 +1756,7 @@ print <<'EOF';
          -
          +

          Source Listing

          Below is the source input I used for this validation:

          @@ -1888,7 +1903,7 @@ sub show_esis ($) { print <<'EOF';
          -
          +

          Raw ESIS Output

           EOF
          @@ -1905,7 +1920,7 @@
           sub show_errors ($) {
             print <<'EOF';