diff options
-rwxr-xr-x | htdocs/docs/install.html | 10 | ||||
-rwxr-xr-x | httpd/cgi-bin/check | 61 | ||||
-rw-r--r-- | misc/bundle/META.yml | 1 | ||||
-rw-r--r-- | misc/bundle/Makefile.PL | 1 | ||||
-rw-r--r-- | misc/bundle/lib/Bundle/W3C/Validator.pm | 1 |
5 files changed, 34 insertions, 40 deletions
diff --git a/htdocs/docs/install.html b/htdocs/docs/install.html index 1261079..48a91da 100755 --- a/htdocs/docs/install.html +++ b/htdocs/docs/install.html @@ -1,5 +1,5 @@ -<!--#set var="revision" value="\$Id: install.html,v 1.58 2009-12-14 22:03:54 ville Exp $" ---><!--#set var="date" value="\$Date: 2009-12-14 22:03:54 $" +<!--#set var="revision" value="\$Id: install.html,v 1.59 2010-03-03 19:13:29 ville Exp $" +--><!--#set var="date" value="\$Date: 2010-03-03 19:13:29 $" --><!--#set var="title" value="Installation Documentation for The W3C Markup Validation Service" --><!--#set var="relroot" value="../" --><!--#include virtual="../header.html" --> @@ -137,11 +137,9 @@ install Bundle::W3C::Validator <dd> Support for multiple character encodings. </dd> - <dt><a href="http://search.cpan.org/dist/HTML-Parser/">HTML-Parser</a> >= 3.24</dt> + <dt><a href="http://search.cpan.org/dist/HTML-Parser/">HTML-Parser</a> >= 3.60</dt> <dd> - Minimal HTML parser used for preparse and finding metadata. Version - 3.24 or newer is required, but the full feature set is available - only if version 3.60 or newer is installed. + Minimal HTML parser used for preparse and finding metadata. </dd> <dt><a href="http://search.cpan.org/dist/HTML-Encoding/">HTML-Encoding</a></dt> <dd> diff --git a/httpd/cgi-bin/check b/httpd/cgi-bin/check index 3ff48f5..ddac822 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.767 2010-03-02 19:28:35 ville Exp $ +# $Id: check,v 1.768 2010-03-03 19:13:29 ville Exp $ # # We need Perl 5.8.0+. @@ -50,17 +50,18 @@ use Encode::HanExtra qw(); # for some chinese character encodings, # e.g gb18030 use File::Spec::Functions qw(catfile rel2abs tmpdir); use HTML::Encoding 0.52 qw(); -use HTML::Parser 3.24 qw(); # Need 3.24 for $p->parse($code_ref) -use HTML::Template 2.6 qw(); # Need 2.6 for path param, other things. +use HTML::HeadParser 3.60 qw(); # Needed for HTML5 meta charset workaround +use HTML::Parser 3.24 qw(); # Need 3.24 for $p->parse($code_ref) +use HTML::Template 2.6 qw(); # Need 2.6 for path param, other things. use HTTP::Headers::Util qw(); -use HTTP::Message 1.52 qw(); # Need 1.52 for decoded_content() +use HTTP::Message 1.52 qw(); # Need 1.52 for decoded_content() use HTTP::Request qw(); -use HTTP::Headers::Auth qw(); # Needs to be imported after other HTTP::*. +use HTTP::Headers::Auth qw(); # Needs to be imported after other HTTP::*. use JSON 2.00 qw(); use SGML::Parser::OpenSP 0.991 qw(); use URI qw(); use URI::Escape qw(uri_escape); -use XML::LibXML 1.56 qw(); # Need 1.56 for line_numbers() +use XML::LibXML 1.56 qw(); # Need 1.56 for line_numbers() ############################################################################### #### Constant definitions. #################################################### @@ -190,7 +191,7 @@ EOF # # Strings - $VERSION = q$Revision: 1.767 $; + $VERSION = q$Revision: 1.768 $; $VERSION =~ s/Revision: ([\d\.]+) /$1/; # Read friendly error message file @@ -3124,35 +3125,27 @@ sub find_encodings # HTML::Encoding doesn't support HTML5 <meta charset> as of 0.60, # check it ourselves. HTML::HeadParser >= 3.60 is required for this. - if (eval { - local $SIG{__DIE__} = undef; - require HTML::HeadParser; - HTML::HeadParser->VERSION(3.60); - } - ) - { - my $hp = HTML::HeadParser->new(); - my $seen_doctype = FALSE; - my $is_html5 = FALSE; - $hp->handler( - declaration => sub { - my ($tag, $text) = @_; - return if ($seen_doctype || uc($tag) ne '!DOCTYPE'); - $seen_doctype = TRUE; - $is_html5 = TRUE - if ( - $text =~ /<!DOCTYPE\s+html + my $hp = HTML::HeadParser->new(); + my $seen_doctype = FALSE; + my $is_html5 = FALSE; + $hp->handler( + declaration => sub { + my ($tag, $text) = @_; + return if ($seen_doctype || uc($tag) ne '!DOCTYPE'); + $seen_doctype = TRUE; + $is_html5 = TRUE + if ( + $text =~ /<!DOCTYPE\s+html (\s+SYSTEM\s+(['"])about:legacy-compat\2)? \s*>/six - ); - }, - 'tag,text' - ); - $hp->parse($File->{Bytes}); - if ($is_html5) { - my $cs = $hp->header('X-Meta-Charset'); - $metah{lc($cs)}++ if (defined($cs) && length($cs)); - } + ); + }, + 'tag,text' + ); + $hp->parse($File->{Bytes}); + if ($is_html5) { + my $cs = $hp->header('X-Meta-Charset'); + $metah{lc($cs)}++ if (defined($cs) && length($cs)); } } diff --git a/misc/bundle/META.yml b/misc/bundle/META.yml index 5063c70..af3782e 100644 --- a/misc/bundle/META.yml +++ b/misc/bundle/META.yml @@ -17,6 +17,7 @@ requires: Encode::JIS2K: 0 File::Spec::Functions: 0 HTML::Encoding: 0.52 + HTML::HeadParser: 3.6 HTML::Parser: 3.24 HTML::Template: 2.6 HTML::Tidy: 0 diff --git a/misc/bundle/Makefile.PL b/misc/bundle/Makefile.PL index 69b5375..311b1a1 100644 --- a/misc/bundle/Makefile.PL +++ b/misc/bundle/Makefile.PL @@ -21,6 +21,7 @@ WriteMakefile( "Encode::HanExtra" => 0, "File::Spec::Functions" => 0, "HTML::Encoding" => 0.52, + "HTML::HeadParser" => 3.60, "HTML::Parser" => 3.24, "HTML::Template" => 2.6, "HTTP::Headers::Auth" => 0, diff --git a/misc/bundle/lib/Bundle/W3C/Validator.pm b/misc/bundle/lib/Bundle/W3C/Validator.pm index e9427c8..43163cb 100644 --- a/misc/bundle/lib/Bundle/W3C/Validator.pm +++ b/misc/bundle/lib/Bundle/W3C/Validator.pm @@ -30,6 +30,7 @@ C<perl -MCPAN -e "install Bundle::W3C::Validator"> Encode::JIS2K - (optional) File::Spec::Functions HTML::Encoding 0.52 + HTML::HeadParser 3.60 HTML::Parser 3.24 HTML::Template 2.6 HTML::Tidy - (optional) |