summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xhttpd/cgi-bin/check5
1 files changed, 4 insertions, 1 deletions
diff --git a/httpd/cgi-bin/check b/httpd/cgi-bin/check
index cbd9370..e1f251c 100755
--- a/httpd/cgi-bin/check
+++ b/httpd/cgi-bin/check
@@ -461,7 +461,10 @@ elsif ($File->{ContentType} =~ m(^text/([-.a-zA-Z0-9]\+)?xml$)) {
elsif ($File->{Charset}->{XML}) {
$File->{Charset}->{Use} = $File->{Charset}->{XML};
}
-elsif ($File->{Charset}->{Auto} =~ /^utf-16[bl]e$/ && $File->{BOM} == 2) {
+elsif ($File->{BOM} &&
+ $File->{BOM} == 2 &&
+ $File->{Charset}->{Auto} =~ /^utf-16[bl]e$/)
+{
$File->{Charset}->{Use} = 'utf-16';
}
elsif ($File->{ContentType} =~ m(^application/([-.a-zA-Z0-9]+\+)?xml$)) {