summaryrefslogtreecommitdiffstats
path: root/httpd
diff options
context:
space:
mode:
authorlink <link@localhost>2002-12-08 01:46:44 +0000
committerlink <link@localhost>2002-12-08 01:46:44 +0000
commit71779cb70e239664a1a35e8c13be35836a0eef4e (patch)
treeacacf3d27287464c278521c31a806bfe43281a8e /httpd
parent262add94eeae250ec23a5223f7bb1563bf7303f2 (diff)
downloadmarkup-validator-71779cb70e239664a1a35e8c13be35836a0eef4e.zip
markup-validator-71779cb70e239664a1a35e8c13be35836a0eef4e.tar.gz
markup-validator-71779cb70e239664a1a35e8c13be35836a0eef4e.tar.bz2
Landing new config code. Badges are borken, the link to the relevant spec
from "This page is valid Foo" is borken, and there is a good chance the DOCTYPE Override is borken. Otherwise this should be more or less working.
Diffstat (limited to 'httpd')
-rwxr-xr-xhttpd/cgi-bin/check87
1 files changed, 23 insertions, 64 deletions
diff --git a/httpd/cgi-bin/check b/httpd/cgi-bin/check
index 4de17ba..78cdcd3 100755
--- a/httpd/cgi-bin/check
+++ b/httpd/cgi-bin/check
@@ -9,7 +9,7 @@
# This source code is available under the license at:
# http://www.w3.org/Consortium/Legal/copyright-software
#
-# $Id: check,v 1.318 2002-12-07 04:00:18 link Exp $
+# $Id: check,v 1.319 2002-12-08 01:46:44 link Exp $
#
# Disable buffering on STDOUT!
@@ -124,8 +124,18 @@ The error reported was: '$@'
if (my $allowed = delete($CFG->{Allowed_Protocols})) {
$CFG->{Allowed_Protocols} = [ split(/\s*,\s*/, $allowed) ];
}
- if (! -x $CFG->{'SGML_Parser'}) {
- die("Configured SGML Parser '$CFG->{'SGML Parser'}' not executable!");
+
+ #
+ # Make sure onsgmls exists and is executable.
+ unless (-x $CFG->{SGML_Parser}) {
+ die qq(Configured SGML Parser "$CFG->{SGML_Parser}" not executable!\n);
+ }
+
+ { # Make types config indexed by FPI.
+ my $_types = {};
+ map {$_types->{$CFG->{Types}->{$_}->{PubID}} = $CFG->{Types}->{$_}}
+ keys %{$CFG->{Types}};
+ $CFG->{Types} = $_types;
}
#
@@ -134,7 +144,7 @@ The error reported was: '$@'
#
# Strings
- $VERSION = q$Revision: 1.318 $;
+ $VERSION = q$Revision: 1.319 $;
$VERSION =~ s/Revision: ([\d\.]+) /$1/;
} # end of BEGIN block.
@@ -143,6 +153,10 @@ The error reported was: '$@'
# Get rid of (possibly insecure) $PATH.
delete $ENV{PATH};
+
+#use Data::Dumper qw(Dumper);
+#print Dumper($CFG);
+#exit;
###############################################################################
#### Process CGI variables and initialize. ####################################
###############################################################################
@@ -579,7 +593,7 @@ if (&is_xml($File) and not $File->{DOCTYPE}) {
#
# Get the pretty text version of the FPI if a mapping exists.
-if (my $prettyver = $CFG->{FPI_to_Text}->{$File->{Version}}) {
+if (my $prettyver = $CFG->{Types}->{$File->{Version}}->{Display}) {
$File->{Version} = $prettyver;
} else {
$File->{Version} = &ent($File->{Version});
@@ -744,64 +758,6 @@ sub report_valid {
my($image_uri, $alttext, $gifhw);
unless ($File->{Version} eq 'unknown' or defined $File->{Tentative}) {
- if ($File->{Version} =~ /^HTML 2\.0$/) {
- $image_uri = "$CFG->{Home_Page}images/vh20";
- $alttext = "Valid HTML 2.0!";
- $gifborder = "";
- } elsif ($File->{Version} =~ /HTML 3\.2</) {
- $image_uri = "http://www.w3.org/Icons/valid-html32";
- $alttext = "Valid HTML 3.2!";
- $gifhw = ' height="31" width="88"';
- } elsif ($File->{Version} =~ /HTML 4\.0<\/a> Strict$/) {
- $image_uri = "http://www.w3.org/Icons/valid-html40";
- $alttext = "Valid HTML 4.0!";
- $gifborder = "";
- $gifhw = ' height="31" width="88"';
- } elsif ($File->{Version} =~ /HTML 4\.0<\/a> /) {
- $image_uri = "http://www.w3.org/Icons/valid-html40";
- $alttext = "Valid HTML 4.0!";
- $gifhw = ' height="31" width="88"';
- } elsif ($File->{Version} =~ /HTML 4\.01<\/a> Strict$/) {
- $image_uri = "http://www.w3.org/Icons/valid-html401";
- $alttext = "Valid HTML 4.01!";
- $gifborder = "";
- $gifhw = ' height="31" width="88"';
- } elsif ($File->{Version} =~ /HTML 4\.01<\/a> /) {
- $image_uri = "http://www.w3.org/Icons/valid-html401";
- $alttext = "Valid HTML 4.01!";
- $gifhw = ' height="31" width="88"';
- } elsif ($File->{Version} =~ /XHTML 1\.0<\/a> /) {
- $image_uri = "http://www.w3.org/Icons/valid-xhtml10";
- $alttext = "Valid XHTML 1.0!";
- $gifborder = "";
- $gifhw = ' height="31" width="88"';
- $xhtmlendtag = " /";
- } elsif ($File->{Version} =~ /XHTML Basic 1.0/) {
- $image_uri = "$CFG->{Home_Page}/images/vxhtml-basic10";
- $alttext = "Valid XHTML Basic 1.0!";
- $gifborder = "";
- $gifhw = ' height="31" width="88"';
- $xhtmlendtag = " /";
- } elsif ($File->{Version} =~ /XHTML 1.1/) {
- $image_uri = "http://www.w3.org/Icons/valid-xhtml11";
- $alttext = "Valid XHTML 1.1!";
- $gifborder = "";
- $gifhw = ' height="31" width="88"';
- $xhtmlendtag = " /";
- } elsif ($File->{Version} =~ /HTML 3\.0/) {
- $image_uri = "$CFG->{Home_Page}images/vh30";
- $alttext = "Valid HTML 3.0!";
- } elsif ($File->{Version} =~ /Netscape/) {
- $image_uri = "$CFG->{Home_Page}images/vhns";
- $alttext = "Valid Netscape-HTML!";
- } elsif ($File->{Version} =~ /Hotjava/) {
- $image_uri = "$CFG->{Home_Page}images/vhhj";
- $alttext = "Valid Hotjava-HTML!";
- } elsif ($File->{Version} =~ /ISO\/IEC 15445:2000/) {
- $image_uri = "$CFG->{Home_Page}images/v15445";
- $alttext = "Valid ISO-HTML!";
- }
-
$T->param(file_version => $File->{Version});
# @@@
@@ -1245,7 +1201,10 @@ sub truncate_line {
sub override_doctype {
no strict 'vars';
my $File = shift;
- local $dtd = $CFG->{Doctypes}->{$File->{Opt}->{DOCTYPE}};
+ my $pubid = $CFG->{Types}->{$File->{Opt}->{DOCTYPE}}->{PubID};
+ my $sysid = $CFG->{Types}->{$File->{Opt}->{DOCTYPE}}->{SysID};
+ my $name = $CFG->{Types}->{$File->{Opt}->{DOCTYPE}}->{Name};
+ local $dtd = qq(<!DOCTYPE $name PUBLIC "$pubid"\n "$sysid">);
local $HTML = '';
local $seen = FALSE;