- From: Olivier Thereaux via cvs-syncmail <cvsmail@w3.org>
- Date: Wed, 21 Nov 2007 06:55:50 +0000
- To: www-validator-cvs@w3.org
Update of /sources/public/validator/httpd/cgi-bin
In directory hutz:/tmp/cvs-serv28362
Modified Files:
check
Log Message:
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
Index: check
===================================================================
RCS file: /sources/public/validator/httpd/cgi-bin/check,v
retrieving revision 1.577
retrieving revision 1.578
diff -u -d -r1.577 -r1.578
--- check 25 Oct 2007 19:43:57 -0000 1.577
+++ check 21 Nov 2007 06:55:48 -0000 1.578
@@ -1600,13 +1600,13 @@
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]);
}
};
Received on Wednesday, 21 November 2007 06:55:57 UTC