diff options
author | ot <ot@localhost> | 2005-03-25 03:42:09 +0000 |
---|---|---|
committer | ot <ot@localhost> | 2005-03-25 03:42:09 +0000 |
commit | eaa635573c29ece79e8699baf39be90e9068c11c (patch) | |
tree | f27a36b2d8f60fb620349dd00e3063aa2edf28d4 /httpd/cgi-bin/check | |
parent | 8a32df99397c7125c39a5d76aea915ee4a141efe (diff) | |
download | markup-validator-eaa635573c29ece79e8699baf39be90e9068c11c.zip markup-validator-eaa635573c29ece79e8699baf39be90e9068c11c.tar.gz markup-validator-eaa635573c29ece79e8699baf39be90e9068c11c.tar.bz2 |
Moving the declaration of template variable for "file_version"
(aka human-readable version of the doctype detected or used) from
valid-only subroutine to a more general location.
Should fix the absence of info next to "Doctype" in the case of
an invalid document.
Diffstat (limited to 'httpd/cgi-bin/check')
-rwxr-xr-x | httpd/cgi-bin/check | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/httpd/cgi-bin/check b/httpd/cgi-bin/check index 078da92..4223bbe 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.409 2005-03-24 09:01:37 ot Exp $ +# $Id: check,v 1.410 2005-03-25 03:42:09 ot Exp $ # # Disable buffering on STDOUT! @@ -220,7 +220,7 @@ Directory not readable (permission denied): @_r # # Strings - $VERSION = q$Revision: 1.409 $; + $VERSION = q$Revision: 1.410 $; $VERSION =~ s/Revision: ([\d\.]+) /$1/; # @@ -838,6 +838,13 @@ if ($File->{Opt}->{Output} eq 'xml') { } else { &prep_template($File, $T); + if (! $File->{Doctype} and ($File->{Version} eq 'unknown' or $File->{Version} eq 'SGML')) { + $T->param(file_version => '(no Doctype found)'); + } + else { + $T->param(file_version => $File->{Version}); + } + if ($File->{'Is Valid'}) { $T->param(VALID => TRUE); $T->param(valid_status => 'Valid'); @@ -932,7 +939,6 @@ sub report_valid { my $T = shift; unless ($File->{Version} eq 'unknown' or defined $File->{Tentative}) { - $T->param(file_version => $File->{Version}); if (exists $CFG->{Types}->{$File->{DOCTYPE}}->{Badge}) { my $cfg = $CFG->{Types}->{$File->{DOCTYPE}}; |