]> git.ipfire.org Git - thirdparty/AWStats.git/commitdiff
Fix: [ 1978533 ] charset empty in header
authoreldy <>
Thu, 25 Sep 2008 17:29:25 +0000 (17:29 +0000)
committereldy <>
Thu, 25 Sep 2008 17:29:25 +0000 (17:29 +0000)
wwwroot/cgi-bin/awstats.pl

index 8d952a778baf0cecfa96ed3761b123426238cf85..42d3ef99577d7d648eac84c6eac45d91dc42dd25 100644 (file)
@@ -551,8 +551,9 @@ sub file_filt (@) {
 #------------------------------------------------------------------------------
 sub http_head {
        if (! $HeaderHTTPSent) {
-               if ($BuildReportFormat eq 'xhtml' || $BuildReportFormat eq 'xml') { print ($ENV{'HTTP_USER_AGENT'}=~/MSIE|Googlebot/i?"Content-type: text/html; charset=$PageCode\n":"Content-type: text/xml; charset=$PageCode\n"); }
-               else { print "Content-type: text/html; charset=$PageCode\n"; }
+               my $newpagecode = $PageCode?$PageCode:"utf-8";
+               if ($BuildReportFormat eq 'xhtml' || $BuildReportFormat eq 'xml') { print ($ENV{'HTTP_USER_AGENT'}=~/MSIE|Googlebot/i?"Content-type:text/html; charset=$newpagecode\n":"Content-type: text/xml; charset=$newpagecode\n"); }
+               else { print "Content-type: text/html; charset=$pagecode\n"; }
 
                # Expires must be GMT ANSI asctime and must be after Content-type to avoid pb with some servers (SAMBAR)
                if ($Expires =~ /^\d+$/) {