- From: Bjoern Hoehrmann via cvs-syncmail <cvsmail@w3.org>
- Date: Mon, 15 Aug 2005 21:08:52 +0000
- To: www-validator-cvs@w3.org
Update of /sources/public/validator/httpd/cgi-bin
In directory hutz:/tmp/cvs-serv10580
Modified Files:
check
Log Message:
more formatting cleanup
Index: check
===================================================================
RCS file: /sources/public/validator/httpd/cgi-bin/check,v
retrieving revision 1.433
retrieving revision 1.434
diff -u -d -r1.433 -r1.434
--- check 15 Aug 2005 20:54:51 -0000 1.433
+++ check 15 Aug 2005 21:08:50 -0000 1.434
@@ -169,7 +169,7 @@
#
# Split allowed protocols into a list.
if (my $allowed = delete($CFG->{Protocols}->{Allow})) {
- $CFG->{Protocols}->{Allow} = [ split(/\s*,\s*/, $allowed) ];
+ $CFG->{Protocols}->{Allow} = [split(/\s*,\s*/, $allowed)];
}
#
@@ -188,10 +188,10 @@
#
# Change strings to internal constants in MIME type mapping.
for (keys %{$CFG->{MIME}}) {
- if ($CFG->{MIME}->{$_} eq 'SGML') {$CFG->{MIME}->{$_} = MODE_SGML}
- elsif ($CFG->{MIME}->{$_} eq 'XML') {$CFG->{MIME}->{$_} = MODE_XML}
- elsif ($CFG->{MIME}->{$_} eq 'TBD') {$CFG->{MIME}->{$_} = MODE_TBD}
- else {$CFG->{MIME}->{$_} = MODE_TBD};
+ if ($CFG->{MIME}->{$_} eq 'SGML') { $CFG->{MIME}->{$_} = MODE_SGML }
+ elsif ($CFG->{MIME}->{$_} eq 'XML') { $CFG->{MIME}->{$_} = MODE_XML }
+ elsif ($CFG->{MIME}->{$_} eq 'TBD') { $CFG->{MIME}->{$_} = MODE_TBD }
+ else { $CFG->{MIME}->{$_} = MODE_TBD }
}
#
@@ -204,8 +204,8 @@
#
# Strings
- $VERSION = q$Revision$;
- $VERSION =~ s/Revision: ([\d\.]+) /$1/;
+ $VERSION = q$Revision$;
+ $VERSION =~ s/Revision: ([\d\.]+) /$1/;
#
# Use passive FTP by default.
@@ -216,7 +216,6 @@
# Get rid of (possibly insecure) $PATH.
delete $ENV{PATH};
-
#@@DEBUG: Dump $CFG datastructure. Used only as a developer aid.
#use Data::Dumper qw(Dumper);
#print Dumper($CFG);
@@ -235,7 +234,6 @@
# The data structure that will hold all session data.
my $File;
-
##############################################
# Populate $File->{Env} -- Session Metadata. #
##############################################
@@ -244,7 +242,6 @@
# The URL to this CGI Script.
$File->{Env}->{'Self URI'} = $q->url(-query => 0);
-
#################################
# Initialize the datastructure. #
#################################
@@ -272,7 +269,6 @@
$File->{Warnings} = []; # Warnings...
$File->{Namespaces} = []; # Other (non-root) Namespaces.
-
###############################################################################
#### Generate Template for Result. ############################################
###############################################################################
@@ -464,9 +460,6 @@
$File->{Charset}->{Use} = $File->{Charset}->{Override};
}
}
-
-
-
}
}
@@ -476,12 +469,10 @@
$File->{Charset}->{Use} = 'utf-8';
}
-
#
# Abort if an error was flagged while finding the encoding.
&abort_if_error_flagged($File, O_CHARSET|O_DOCTYPE);
-
#
# Check the detected Encoding and transcode.
if (&conflict($File->{Charset}->{Use}, 'utf-8')) {
@@ -489,7 +480,6 @@
&abort_if_error_flagged($File, O_CHARSET);
}
-
$File = &check_utf8($File); # always check
$File = &byte_error($File);
@@ -497,8 +487,6 @@
# Abort if an error was flagged during transcoding
&abort_if_error_flagged($File, O_SOURCE|O_CHARSET);
-
-
#
# Overall parsing algorithm for documents returned as text/html:
#
@@ -604,7 +592,6 @@
# }
}
-
#
# Defaults for SP; turn off fixed charset mode and set encoding to UTF-8.
$ENV{SP_CHARSET_FIXED} = 'NO';
@@ -619,7 +606,6 @@
# Set the command to execute.
my @cmd = ($CFG->{Paths}->{SGML}->{Parser}, '-n', '-c', $catalog, @spopt);
-
#
# Set debug info for HTML report.
$T->param(opt_debug => $DEBUG);
@@ -757,7 +743,6 @@
$File->{Version} = $prettyver;
}
-
#
# Warn about unknown, incorrect, or missing Namespaces.
if ($File->{Namespace}) {
@@ -789,9 +774,6 @@
} else {
&prep_template($File, $T);
-
-
-
if (! $File->{Doctype} and ($File->{Version} eq 'unknown' or $File->{Version} eq 'SGML' or (!$File->{Version}))) {
# @@TODO@@ we should try falling back on other version info, such as the ones stored in Version_ESIS
$T->param(file_version => '(no Doctype found)');
@@ -843,7 +825,6 @@
undef $File;
exit;
-
#############################################################################
# Subroutine definitions
#############################################################################
@@ -917,7 +898,6 @@
my $over_charset_param = "override charset $File->{Opt}->{Charset}";
$T->param($over_charset_param => TRUE);
}
-
}
#
@@ -2174,10 +2154,10 @@
$err->{idx} = $err->{msg};
$err->{idx} =~ s/"[^\"]*"/FOO/g;
$err->{idx} =~ s/[^A-Za-z ]//g;
- $err->{idx} =~ s/\s+/ /g; # Collapse spaces
- $err->{idx} =~ s/(^\s|\s$)//g; # Remove leading and trailing spaces.
+ $err->{idx} =~ s/\s+/ /g; # Collapse spaces
+ $err->{idx} =~ s/(^\s|\s$)//g; # Remove leading and trailing spaces.
$err->{idx} =~ s/(FOO )+/FOO /g; # Collapse FOOs.
- $err->{idx} =~ s/FOO FOO/FOO/g; # Collapse FOOs.
+ $err->{idx} =~ s/FOO FOO/FOO/g; # Collapse FOOs.
my $offset = $File->{Offsets}->[$err->{line} - 1]->[1] + $err->{char};
printf <<".EOF.", &ent($err->{msg});
@@ -2566,7 +2546,7 @@
}
if ($iptype && $iptype ne 'PUBLIC') {
my $File = $self->{'W3C::Validator::File'};
- $File->{'Error Flagged'} = 1;
+ $File->{'Error Flagged'} = 1;
$File->{E}->param(fatal_ip_error => 1);
$File->{E}->param(fatal_ip_hostname => 1)
if $addr and $uri->host() ne $addr;
Received on Monday, 15 August 2005 21:08:58 UTC