diff options
author | ot <ot@localhost> | 2007-11-21 06:55:48 +0000 |
---|---|---|
committer | ot <ot@localhost> | 2007-11-21 06:55:48 +0000 |
commit | d468486bdc4d2096d1baa9e4ab5b5c9accd9e7ab (patch) | |
tree | 615abd38e0542af407e7dd156519ddb308399275 | |
parent | 61171c3ac408a9f260459b0c1ab9217495ffbd31 (diff) | |
download | markup-validator-d468486bdc4d2096d1baa9e4ab5b5c9accd9e7ab.zip markup-validator-d468486bdc4d2096d1baa9e4ab5b5c9accd9e7ab.tar.gz markup-validator-d468486bdc4d2096d1baa9e4ab5b5c9accd9e7ab.tar.bz2 |
Make sure (looks like a regression) that we do not perform override of a doctype upon itself
See e.g:
http://lists.w3.org/Archives/Public/www-validator/2007Nov/0038.html
-rwxr-xr-x | httpd/cgi-bin/check | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/httpd/cgi-bin/check b/httpd/cgi-bin/check index 41ab530..dafaffa 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.577 2007-10-25 19:43:57 ville Exp $ +# $Id: check,v 1.578 2007-11-21 06:55:48 ot Exp $ # # Disable buffering on STDOUT! @@ -186,7 +186,7 @@ Directory not readable (permission denied): @_r # # Strings - $VERSION = q$Revision: 1.577 $; + $VERSION = q$Revision: 1.578 $; $VERSION =~ s/Revision: ([\d\.]+) /$1/; # @@ -1600,13 +1600,13 @@ sub override_doctype { my $declaration = sub { $seen = TRUE; - # No Override if Fallback was requested. - if ($File->{Opt}->{FB}->{DOCTYPE}) { + $org_dtd = &ent($_[0]); + ($File->{Root}, $File->{DOCTYPE}) = $_[0] =~ m(<!DOCTYPE\s+(\w[\w\.-]+)\s+(?:PUBLIC|SYSTEM)\s+(?:[\'\"])([^\"\']+)(?:[\"\']).*>)si; + # No Override if Fallback was requested, or if override is the same as detected + if ($File->{Opt}->{FB}->{DOCTYPE} or ($File->{Opt}->{DOCTYPE} eq $CFG->{Types}->{$File->{DOCTYPE}}->{Display} )) { $HTML .= $_[0]; # Stash it as is... } else { - # Comment it out and insert the new one... $HTML .= "$dtd\n" . '<!-- ' . $_[0] . ' -->'; - $org_dtd = &ent($_[0]); } }; |