diff -Naru validator.orig/httpd/cgi-bin/checklink.pl validator/httpd/cgi-bin/checklink.pl --- validator.orig/httpd/cgi-bin/checklink.pl Fri Sep 21 17:15:53 2001 +++ validator/httpd/cgi-bin/checklink.pl Sat Oct 6 14:03:30 2001 @@ -1,4 +1,4 @@ -#! /usr/bin/perl -w +#!/usr/bin/perl -w # # W3C Link Checker # by Hugo Haas @@ -26,11 +26,11 @@ use strict; package W3C::UserAgent; -use LWP::UserAgent; +use LWP::UserAgent (); @W3C::UserAgent::ISA = qw(LWP::UserAgent); package W3C::CheckLink; -use HTML::Parser 3; +use HTML::Parser 3 (); @W3C::CheckLink::ISA = qw(HTML::Parser); # Autoflush @@ -104,7 +104,7 @@ printf("\n%s\n", &global_stats()); } } else { - use CGI; + use CGI (); use CGI::Carp qw(fatalsToBrowser); $query = new CGI; # Set a few parameters in CGI mode @@ -272,7 +272,7 @@ for example, it would be: http://www.w3.org/TR/html4/ -n/--noacclanguage Do not send an Accept-Language header. - -L/--languages Languages accepted (default: '$_languages'). + -L/--languages Languages accepted (default: '$_languages'). -q/--quiet No output if no errors are found. -v/--verbose Verbose mode. -i/--indicator Show progress while parsing. @@ -315,7 +315,7 @@ ########################################### sub urize() { - use URI; + use URI (); $_ = URI::Escape::uri_unescape($_[0]); my $base; my $res = $_; @@ -375,7 +375,7 @@ if ($_html) { print("\n"); if (! $_summary) { - use URI; + use URI (); printf("

Go to the results.

\n", $result_anchor); printf("

Check also: @@ -393,7 +393,7 @@ $processed{$absolute_uri} = 1; # Parse the document my $p = &parse_document($uri, $absolute_uri, - $response->content(), 1, + $response->content(), 1, $depth != 0); my $base = URI->new($p->{base}); @@ -555,7 +555,7 @@ # For the online version, wait for a while to avoid abuses if (!$_cl) { if ($doc_count == $_max_documents) { - print("


\n

Maximum number of documents reached!

\n"); + print("
\n

Maximum number of documents reached!

\n"); } if ($doc_count >= $_max_documents) { $doc_count++; @@ -564,7 +564,7 @@ next; } } - print('
'); + print('
'); sleep($_sleep_time); } print "\n"; @@ -684,7 +684,7 @@ sub W3C::UserAgent::redirect_ok { my ($self, $request) = @_; - + if (! ($_summary || (!$doc_count && $_html))) { &hprintf("\n%s %s ", $request->method(), $request->uri()); } @@ -770,7 +770,7 @@ print "\n"; } return &get_uri($method, $response->request->url, - $start, $ua->{Redirects}, + $start, $ua->{Redirects}, $code, $realm, $message, 1); } # Record the redirects @@ -1072,7 +1072,6 @@ ################################ sub check_validity() { - use HTTP::Status; my ($testing, $uri, $links, $redirects) = @_; # $testing is the URI of the document checked # $uri is the URI of the target that we are verifying @@ -1156,10 +1155,10 @@ } sub escape_match($, \%) { - use URI::Escape; - my ($a, $hash) = (uri_unescape($_[0]), $_[1]); + use URI::Escape (); + my ($a, $hash) = (URI::Escape::uri_unescape($_[0]), $_[1]); foreach $b (keys %$hash) { - if ($a eq uri_unescape($b)) { + if ($a eq URI::Escape::uri_unescape($b)) { return(1); } } @@ -1174,15 +1173,15 @@ my $r = $_[0]; $r->headers->www_authenticate =~ /Basic realm=\"([^\"]+)\"/; my $realm = $1; - my $authHeader = $r->headers->www_authenticate; + my $authHeader = $r->headers->www_authenticate; if ($_cl) { printf(STDERR "\nAuthentication is required for %s.\n", $r->request->url); printf(STDERR "The realm is %s.\n", $realm); print(STDERR "Use the -u and -p options to specify a username and password.\n"); } else { - printf("Status: 401 Authorization Required\nWWW-Authenticate: %s\nConnection: close\nContent-Type: text/html\n\n", $r->headers->www_authenticate); - printf(" - + printf("Status: 401 Authorization Required\nWWW-Authenticate: %s\nConnection: close\nContent-Language: en\nContent-Type: text/html; charset=ISO-8859-1\n\n", $r->headers->www_authenticate); + printf(" + 401 Authorization Required @@ -1354,7 +1353,7 @@ $whattodo = 'You must change this link: people using a browser without Javascript support will not be able to follow this link. See the -Web +Web Content Accessibility Guidelines on the use of scripting on the Web and the techniques @@ -1404,14 +1403,14 @@ } printf(" %s -
What to do: %s%s
-
HTTP Code returned: %d%s
+
What to do: %s%s
+
HTTP Code returned: %d%s
HTTP Message: %s%s%s
Lines: %s
\n", # Anchor for return codes $idref, # List of redirects - $redirected ? join(' redirected to
', + $redirected ? join(' redirected to
', @redirects_urls) : &show_url($u), # Color &bgcolor($c), @@ -1429,12 +1428,12 @@ : '', # Realm (defined($results->{$u}{location}{realm}) - ? 'Realm: '.&encode($results->{$u}{location}{realm}).'
' + ? 'Realm: '.&encode($results->{$u}{location}{realm}).'
' : ''), # HTTP original message defined($results->{$u}{location}{orig_message}) ? &encode($results->{$u}{location}{orig_message}). - ' -> ' + ' -> ' : '', # HTTP final message $http_message, @@ -1499,7 +1498,7 @@ } } } - # End of the table + # End of the table if ($_html) { print("\n"); } @@ -1658,7 +1657,7 @@ my $stop = &get_timestamp(); return sprintf("Checked %d document(s) in %ss.", ($doc_count<=$_max_documents? $doc_count : $_max_documents), - &time_diff($timestamp, $stop)); + &time_diff($timestamp, $stop)); } ################## @@ -1672,13 +1671,13 @@ print "Cache-Control: no-cache\nPragma: no-cache\n"; } if (! $_cl) { - print "Content-Type: text/html; charset=iso-8859-1\nContent-Language: en"; + print "Content-Type: text/html; charset=ISO-8859-1\nContent-Language: en"; } my $title = ' Link Checker'.($uri eq '' ? '' : ': '.$uri); print " - - + + W3C".$title." -
\"W3C\" +

\"W3C\"

W3C®".$title."

\n"; } @@ -1765,15 +1764,15 @@ } print " -
+
-$PROGRAM $VERSION
+$PROGRAM $VERSION
Written by Hugo Haas. Please send bug reports, suggestions and comments to the www-validator mailing list (archives). -
+
Check out the documentation. Download the @@ -1803,22 +1802,22 @@ print "
self_url()."\" method=\"get\">

Enter the address (URL) of a document that you would like to check:

-

+

Options:

- Summary only -
- Hide redirects -
- Don't send Accept-Language headers. -
- Hide directory redirects -
- Check linked documents recursively (maximum: $_max_documents documents; sleeping $_sleep_time seconds between each document) -
- Depth of the recursion: (-1 is the default and means unlimited) + Summary only +
+ Hide redirects +
+ Don't send Accept-Language headers. +
+ Hide directory redirects +
+ Check linked documents recursively (maximum: $_max_documents documents; sleeping $_sleep_time seconds between each document) +
+ Depth of the recursion: (-1 is the default and means unlimited)

-

+

"; &html_footer();