markup-validator commit: Avoid lc(undef) warnings with Perl >= 5.12.

changeset:   3214:1a0d7586fd5d
tag:         tip
user:        Ville Skyttä <ville.skytta@iki.fi>
date:        Sat Mar 12 15:20:20 2011 +0200
files:       httpd/cgi-bin/check
description:
Avoid lc(undef) warnings with Perl >= 5.12.


diff -r c2a8c311f2b4 -r 1a0d7586fd5d httpd/cgi-bin/check
--- a/httpd/cgi-bin/check	Thu Mar 10 22:48:10 2011 +0200
+++ b/httpd/cgi-bin/check	Sat Mar 12 15:20:20 2011 +0200
@@ -1878,7 +1878,7 @@
     $File->{ContentLang}     = $res->content_language;
     $File->{ContentLoc}      = $res->header('Content-Location');
     $File->{TransferEnc}     = $res->header('Client-Transfer-Encoding');
-    $File->{Charset}->{HTTP} = lc $charset;
+    $File->{Charset}->{HTTP} = lc $charset if defined $charset;
     $File->{Modified}        = $res->header('Last-Modified');
     $File->{Server}          = scalar $res->server;
 
@@ -1921,7 +1921,7 @@
     $File->{Bytes}           = $file;
     $File->{Mode}            = $mode;
     $File->{ContentType}     = $ct;
-    $File->{Charset}->{HTTP} = lc $charset;
+    $File->{Charset}->{HTTP} = lc $charset if defined $charset;
     $File->{Modified}        = $q->http('Last-Modified');
     $File->{Server}          = $q->http('User-Agent');   # Fake a "server". :-)
     $File->{Size}           = $q->http('Content-Length');

Received on Saturday, 12 March 2011 13:20:35 UTC