W3C home > Mailing lists > Public > www-validator-cvs@w3.org > December 2010

markup-validator commit: Avoid error log trashing from BOM lookup on empty documents.

From: Mercurial notifier <nobody@w3.org>
Date: Tue, 14 Dec 2010 22:15:58 +0000
Message-Id: <E1PSdA6-0003eF-2C@mcbain.w3.org>
To: markup-validator updates <www-validator-cvs@w3.org>
changeset:   3195:d933a252d9bc
tag:         tip
user:        Ville Skyttä <ville.skytta@iki.fi>
date:        Wed Dec 15 00:15:52 2010 +0200
files:       httpd/cgi-bin/check
description:
Avoid error log trashing from BOM lookup on empty documents.


diff -r c1b3289341f5 -r d933a252d9bc httpd/cgi-bin/check
--- a/httpd/cgi-bin/check	Wed Dec 15 00:05:28 2010 +0200
+++ b/httpd/cgi-bin/check	Wed Dec 15 00:15:52 2010 +0200
@@ -558,7 +558,7 @@
 
 #
 # Add a warning if doc is UTF-8 and contains a BOM.
-if ($File->{Charset}->{Use} eq 'utf-8' &&
+if ($File->{Charset}->{Use} eq 'utf-8' && @{$File->{Content}} &&
     $File->{Content}->[0] =~ m(^\x{FEFF}))
 {
     &add_warning('W21', {});
Received on Tuesday, 14 December 2010 22:15:59 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:17:44 UTC