From 044b8bf096898b8432ebc5c505f63fb6373c15f8 Mon Sep 17 00:00:00 2001 From: Ivan Tcholakov Date: Thu, 25 Jun 2009 20:09:21 +0200 Subject: [PATCH] [svn r21619] FS#306 - The global initialization script: Ensuring that the global variable $charset will stay unaffected after loading language files. --- main/inc/global.inc.php | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/main/inc/global.inc.php b/main/inc/global.inc.php index e2e454e4ce..5efd249671 100644 --- a/main/inc/global.inc.php +++ b/main/inc/global.inc.php @@ -256,6 +256,8 @@ while ($row = @mysql_fetch_array($result)) { if (empty($charset)) { $charset = "ISO-8859-15"; } +// Preserving the value of the global variable $charset. +$charset_initial_value = $charset; // Initialization of the default encoding that will be used by the string routines. api_set_default_encoding($charset); @@ -603,15 +605,9 @@ if (is_array($language_files)) { } } -/* -// TODO: This is a duplicate initialization of the global variable $charset, see above. To be removed. -//load the charset param after langs because the $charset variable in -//trad4all.inc.php might have set it and we don't want that -$charset = api_get_setting('platform_charset'); -if (empty($charset)) { - $charset = 'ISO-8859-15'; -} -*/ +// The global variable $charset has been defined in a language file too (trad4all.inc.php), this is legacy situation. +// So, we have to reassign this variable again in order to keep its value right. +$charset = $charset_initial_value; //Update of the logout_date field in the table track_e_login (needed for the calculation of the total connection time)