Navigation Menu

Skip to content

Commit

Permalink
Set and force the LC_NUMERIC locale to the system locale before it ge…
Browse files Browse the repository at this point in the history
…ts overwritten in the language file setlocale(LC_ALL, ..) call. With LC_ALL, languages other than english would have float/decimal values as 1,0 instead of 1.0 (osCommerce#634)
  • Loading branch information
haraldpdl committed Sep 25, 2013
1 parent 59e81a0 commit 1464f70
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions catalog/admin/includes/application_top.php
Expand Up @@ -164,7 +164,10 @@
}

// include the language translations
$_system_locale_numeric = setlocale(LC_NUMERIC, 0);
require(DIR_WS_LANGUAGES . $language . '.php');
setlocale(LC_NUMERIC, $_system_locale_numeric); // Prevent LC_ALL from setting LC_NUMERIC which results in 1,0 float/decimal values instead of 1.0 (see bug #634)

$current_page = basename($PHP_SELF);
if (file_exists(DIR_WS_LANGUAGES . $language . '/' . $current_page)) {
include(DIR_WS_LANGUAGES . $language . '/' . $current_page);
Expand Down
2 changes: 2 additions & 0 deletions catalog/includes/application_top.php
Expand Up @@ -278,7 +278,9 @@
}

// include the language translations
$_system_locale_numeric = setlocale(LC_NUMERIC, 0);
require(DIR_WS_LANGUAGES . $language . '.php');
setlocale(LC_NUMERIC, $_system_locale_numeric); // Prevent LC_ALL from setting LC_NUMERIC which results in 1,0 float/decimal values instead of 1.0 (see bug #634)

// currency
if (!tep_session_is_registered('currency') || isset($HTTP_GET_VARS['currency']) || ( (USE_DEFAULT_LANGUAGE_CURRENCY == 'true') && (LANGUAGE_CURRENCY != $currency) ) ) {
Expand Down

0 comments on commit 1464f70

Please sign in to comment.