diff options
-rwxr-xr-x | httpd/cgi-bin/check | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/httpd/cgi-bin/check b/httpd/cgi-bin/check index 0cf6ca6..91adf57 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.751 2009-12-12 20:06:36 ville Exp $ +# $Id: check,v 1.752 2009-12-14 20:44:49 ville Exp $ # # We need Perl 5.8.0+. @@ -197,7 +197,7 @@ EOF # # Strings - $VERSION = q$Revision: 1.751 $; + $VERSION = q$Revision: 1.752 $; $VERSION =~ s/Revision: ([\d\.]+) /$1/; # Read friendly error message file @@ -619,9 +619,14 @@ if (&is_xml($File)) { # the XML parser will check the value of encoding attribute in XML # declaration so we have to amend it to reflect transcoding. # see Bug 4867 - $xml_string =~ s/(<\?xml.*) - (encoding[\x20|\x09|\x0D|\x0A]*=[\x20|\x09|\x0D|\x0A]*(?:"[A-Za-z][a-zA-Z0-9_-]+"|'[A-Za-z][a-zA-Z0-9_-]+')) - (.*\?>)/$1encoding="utf-8"$3/sx; + $xml_string =~ s/ + (^<\?xml\b[^>]*[\x20\x09\x0D\x0A]) + (encoding[\x20\x09\x0D\x0A]*=[\x20\x09\x0D\x0A]* + (?:(["'])[A-Za-z][a-zA-Z0-9_-]+\3) + ) + ([^>].*\?>) + /$1encoding="UTF-8"$4/sx; + eval { $xmlparser->parse_string($xml_string); }; $xml_string = undef; my $xml_parse_errors_line = undef; |