summaryrefslogtreecommitdiffstats
path: root/httpd/cgi-bin/check
diff options
context:
space:
mode:
authorVille Skytt? <ville.skytta@iki.fi>2010-07-15 19:05:24 +0300
committerVille Skytt? <ville.skytta@iki.fi>2010-07-15 19:05:24 +0300
commita7a2572cf4f7c47d4d63921aed90b90eb8a09928 (patch)
tree720e221b6a69b6bb49f78ae11988c8035e4ba643 /httpd/cgi-bin/check
parent293d0f7a5ff4c6548569f22f79cae55441ef65e2 (diff)
downloadmarkup-validator-a7a2572cf4f7c47d4d63921aed90b90eb8a09928.zip
markup-validator-a7a2572cf4f7c47d4d63921aed90b90eb8a09928.tar.gz
markup-validator-a7a2572cf4f7c47d4d63921aed90b90eb8a09928.tar.bz2
Don't filter out undefined entity errors from libxml.
We let libxml fetch external entities now (and use catalogs with it) so false positives should no longer occur.
Diffstat (limited to 'httpd/cgi-bin/check')
-rwxr-xr-xhttpd/cgi-bin/check37
1 files changed, 1 insertions, 36 deletions
diff --git a/httpd/cgi-bin/check b/httpd/cgi-bin/check
index f048268..f303952 100755
--- a/httpd/cgi-bin/check
+++ b/httpd/cgi-bin/check
@@ -1277,21 +1277,7 @@ sub xmlwf (\$)
&override_charset($File, "UTF-8");
- my $xml_string = join "\n", @{$File->{Content}};
-
- my $xmlws = qr/[\x20\x09\x0D\x0A]/o;
-
- # Is the document standalone? Need to check with a regex because the
- # parser may fail to return a document we could use for this.
- my $standalone = (
- $xml_string =~ /^<\?xml\b[^>]*${xmlws}
- standalone${xmlws}*=${xmlws}*
- (["'])yes\1
- /sox
- );
-
- eval { $xmlparser->parse_string($xml_string); };
- $xml_string = undef;
+ eval { $xmlparser->parse_string(join("\n", @{$File->{Content}})); };
my @xmlwf_error_list;
if (ref($@)) {
@@ -1311,16 +1297,6 @@ sub xmlwf (\$)
$err_obj = $err_obj->_prev();
- # The validator will sometimes fail to dereference entities files;
- # we're filtering the resulting bogus error for non-standalone
- # documents. @@@TODO: is this still needed?
- if (!$standalone &&
- $err->{msg} =~ /Entity '\w+' not defined/)
- {
- $err = undef;
- next;
- }
-
unshift(@xmlwf_error_list, $err);
}
}
@@ -1411,17 +1387,6 @@ sub xmlwf (\$)
$err->{type} = "E";
$err->{msg} = $xmlwf_error_msg;
- # The validator will sometimes fail to dereference entities
- # files; we're filtering the resulting bogus error for
- # non-standalone documents. @@@TODO: is this still needed?
- if (!$standalone &&
- $err->{msg} =~ /Entity '\w+' not defined/)
- {
- $xmlwf_error_line = undef;
- $xmlwf_error_col = undef;
- $xmlwf_error_msg = undef;
- next;
- }
push(@xmlwf_error_list, $err);
$xmlwf_error_line = undef;
$xmlwf_error_col = undef;