summaryrefslogtreecommitdiffstats
path: root/httpd/cgi-bin/check
diff options
context:
space:
mode:
authorot <ot@localhost>2007-07-19 08:18:31 +0000
committerot <ot@localhost>2007-07-19 08:18:31 +0000
commitf11f7e9050d68a18a70b2035f56c82a9baf720fd (patch)
tree1e65468018e693e9c02614ffbcadae02733f2c09 /httpd/cgi-bin/check
parentdf7f4b4de4c1770008fd15cef497d7642877d43f (diff)
downloadmarkup-validator-f11f7e9050d68a18a70b2035f56c82a9baf720fd.zip
markup-validator-f11f7e9050d68a18a70b2035f56c82a9baf720fd.tar.gz
markup-validator-f11f7e9050d68a18a70b2035f56c82a9baf720fd.tar.bz2
re-populating the list of charsets (from older revisions in both branch 0.7 and 0.8)
to be used thus: * no fatal error if the charset is supported by encode * a warning with the suggestion for a better alias if we know one * a warning that the encoding may be "odd" if not in the list but encode says it's OK
Diffstat (limited to 'httpd/cgi-bin/check')
-rwxr-xr-xhttpd/cgi-bin/check20
1 files changed, 15 insertions, 5 deletions
diff --git a/httpd/cgi-bin/check b/httpd/cgi-bin/check
index 5a6387c..ad5f1e2 100755
--- a/httpd/cgi-bin/check
+++ b/httpd/cgi-bin/check
@@ -14,7 +14,7 @@
# This source code is available under the license at:
# http://www.w3.org/Consortium/Legal/copyright-software
#
-# $Id: check,v 1.542 2007-07-19 06:21:03 ot Exp $
+# $Id: check,v 1.543 2007-07-19 08:18:30 ot Exp $
#
# Disable buffering on STDOUT!
@@ -183,7 +183,7 @@ Directory not readable (permission denied): @_r
#
# Strings
- $VERSION = q$Revision: 1.542 $;
+ $VERSION = q$Revision: 1.543 $;
$VERSION =~ s/Revision: ([\d\.]+) /$1/;
#
@@ -2090,7 +2090,7 @@ sub transcode {
my $cs = $exact_charset;
if ($CFG->{Charsets}->{$cs}) {
- if ($CFG->{Charsets}->{$cs} =~ /Encoding Forbidden/) {
+ if ($CFG->{Charsets}->{$cs} =~ /ERR /) {
# The encoding is not supported due to policy
$File->{'Error Flagged'} = TRUE;
@@ -2102,10 +2102,13 @@ sub transcode {
"This encoding is not supported by the validator.");
return $File;
}
- else {
+ elsif ($CFG->{Charsets}->{$cs} =~ /X /) {
+ # possibly problematic, we recommend another alias
+ my $recommended_charset = $CFG->{Charsets}->{$cs};
+ $recommended_charset =~ s/X //;
&add_warning('W22', {
W22_declared => $cs,
- W22_suggested => $CFG->{Charsets}->{$cs},
+ W22_suggested => $recommended_charset,
});
}
}
@@ -2127,6 +2130,13 @@ sub transcode {
return $File;
}
+ elsif (!$CFG->{Charsets}->{$cs}) {
+ # not in the list, but technically OK -> we warn
+ &add_warning('W23', {
+ W23_declared => $cs,
+ });
+
+ }
my $output;
my $input = $File->{Bytes};