Skip to content

Commit a139177

Browse files
committed
fixed utf8 by adding appropriate files directive to htaccess
1 parent 64055d9 commit a139177

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

server/conf/goaccess_index.php.master

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<?php
2-
header('Content-type: text/html; charset=utf-8');
32
$yearmonth_text = "Jump to previous stats: ";
43
$script = "<script>function load_content(url){var iframe = document.getElementById(\"content\");iframe.src = url;}</script>\n";
54

@@ -61,7 +60,7 @@ foreach ($goaprev as $key => $value)
6160
$goaccessindex = 'goaindex.html';
6261

6362
$html = "<!DOCTYPE html>\n<html>\n<head>\n<title>Stats</title>\n";
64-
$html .= "<meta charset="UTF-8">\n";
63+
$html .= "<meta charset=\"UTF-8\">\n";
6564
$html .= "<style>\nhtml,body {margin:0px;padding:0px;width:100%;height:100%;background-color: #ccc;}\n";
6665
$html .= "#header\n{\nwidth:100%;margin:0px auto;\nheight:20px;\nposition:fixed;\npadding:4px;\ntext-align:center;\n}\n";
6766
$html .= "iframe {width:100%;height:95%;margin:0px;margin-top:40px;border:0px;padding:0px;}\n</style>\n</head>\n<body>\n";

server/lib/classes/cron.d/150-goaccess.inc.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,7 @@ public function onRunJob() {
191191
* For versions prior 1.4 you need GoAccess with B+Tree support compiled!
192192
*/
193193

194-
195-
$sql_user = "SELECT client_id FROM sys_group WHERE groupid = ?";
194+
$sql_user = "SELECT client_id FROM sys_group WHERE groupid = ?";
196195
$rec_user = $app->db->queryOneRecord($sql_user, $rec['sys_groupid']);
197196
$lang_query = "SELECT country,language FROM client WHERE client_id = ?";
198197
$lang_user = $app->db->queryOneRecord($lang_query, $rec_user['client_id']);
@@ -204,16 +203,16 @@ public function onRunJob() {
204203
$cust_lang = 'en_UK.UTF-8';
205204
break;
206205
case 'br':
207-
$cust_lang = 'pt_BR.UTF-8';
206+
$cust_lang = 'pt_PT.UTF-8';
208207
break;
209208
case 'ca':
210-
$cust_lang = 'en_CA.UTF-8';
209+
$cust_lang = 'en_US.UTF-8';
211210
break;
212211
case 'ja':
213212
$cust_lang = 'ja_JP.UTF-8';
214213
break;
215214
case 'ar':
216-
$cust_lang = 'es_AR.UTF-8';
215+
$cust_lang = 'es_ES.UTF-8';
217216
break;
218217
case 'el':
219218
$cust_lang = 'el_GR.UTF-8';
@@ -229,7 +228,6 @@ public function onRunJob() {
229228
break;
230229
}
231230

232-
echo $cust_lang ."\n\n";
233231
if(version_compare($goaccess_version,1.4) >= 0) {
234232
$app->system->exec_safe("LANG=? goaccess -f ? --config-file ? --restore --persist --db-path=? --output=?", $cust_lang, $logfile, $goaccess_conf, $goa_db_dir, $output_html);
235233
} else {

server/plugins-available/apache2_plugin.inc.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1893,7 +1893,7 @@ function update($event_name, $data) {
18931893

18941894
if($data['new']['stats_type'] != '') {
18951895
if(!is_dir($data['new']['document_root'].'/' . $web_folder . '/stats')) $app->system->mkdir($data['new']['document_root'].'/' . $web_folder . '/stats');
1896-
$ht_file = "AuthType Basic\nAuthName \"Members Only\"\nAuthUserFile ".$data['new']['document_root']."/web/stats/.htpasswd_stats\nrequire valid-user\nDirectoryIndex index.html index.php\nHeader unset Content-Security-Policy";
1896+
$ht_file = "AuthType Basic\nAuthName \"Members Only\"\nAuthUserFile ".$data['new']['document_root']."/web/stats/.htpasswd_stats\nrequire valid-user\nDirectoryIndex index.html index.php\nHeader unset Content-Security-Policy\n<Files \"goaindex.html\">\nAddDefaultCharset UTF-8\n</Files>\n";
18971897
$app->system->file_put_contents($data['new']['document_root'].'/' . $web_folder . '/stats/.htaccess', $ht_file);
18981898
$app->system->chmod($data['new']['document_root'].'/' . $web_folder . '/stats/.htaccess', 0755);
18991899
unset($ht_file);

0 commit comments

Comments
 (0)