validator/httpd/cgi-bin check,1.631,1.632

Update of /sources/public/validator/httpd/cgi-bin
In directory hutz:/tmp/cvs-serv17902

Modified Files:
	check 
Log Message:
Avoid error log warnings when overriding an unknown (e.g. system id only) doctype.

Index: check
===================================================================
RCS file: /sources/public/validator/httpd/cgi-bin/check,v
retrieving revision 1.631
retrieving revision 1.632
diff -u -d -r1.631 -r1.632
--- check	6 Jan 2009 21:12:06 -0000	1.631
+++ check	6 Jan 2009 21:21:08 -0000	1.632
@@ -1773,7 +1773,9 @@
     $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} )) {
+    my $known = $CFG->{Types}->{$File->{DOCTYPE}};
+    if ($File->{Opt}->{FB}->{DOCTYPE} or
+        ($known && $File->{Opt}->{DOCTYPE} eq $known->{Display})) {
       $HTML .= $_[0]; # Stash it as is...
     } else {
       $HTML .= "$dtd<!-- $_[0] -->";
@@ -1806,7 +1808,9 @@
   $File->{Content} = [split /\n/, $HTML];
 
   if ($seen_doctype) {
-    unless (($File->{Opt}->{FB}->{DOCTYPE}) or ($File->{Opt}->{DOCTYPE} eq $CFG->{Types}->{$File->{DOCTYPE}}->{Display} )) {
+    my $known = $CFG->{Types}->{$File->{DOCTYPE}};
+    unless ($File->{Opt}->{FB}->{DOCTYPE} or
+            ($known && $File->{Opt}->{DOCTYPE} eq $known->{Display} )) {
       &add_warning('W13', {
         W13_org => $org_dtd,
         W13_new => $File->{Opt}->{DOCTYPE},

Received on Tuesday, 6 January 2009 21:21:20 UTC