From ec58aadd941ac573b4b1c43742e20a456ddbf800 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 7 Aug 2017 10:12:47 +0200 Subject: [PATCH] www: do not set LC_ALL locale Since we have removed WITHOUT_LOCALES in src.conf a while back this call here causes undesided side effects. Remove this to restore the behaviour to what it was before the locales were added. Spotted by: @adschellevis Also see: https://github.com/opnsense/tools/commit/e988255 This reverts commit 930f7974e6cc842e0741554ecabfb0f68d39ac11. This reverts commit dc53c74c0721ca7f2a467ea54620c5ef71ddbdfd. --- src/etc/rc.initial.restore | 4 ++-- src/www/guiconfig.inc | 1 - src/www/widgets/api/plugins/traffic.inc | 3 ++- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/etc/rc.initial.restore b/src/etc/rc.initial.restore index c0292b821..06620f91a 100755 --- a/src/etc/rc.initial.restore +++ b/src/etc/rc.initial.restore @@ -44,8 +44,8 @@ DATED= for BACKUP in ${BACKUPS}; do DATETIME=${BACKUP#*config-} DATETIME=${DATETIME%.xml} - SUBSEC=${DATETIME#*[.,]} - DATETIME=${DATETIME%[.,]*} + SUBSEC=${DATETIME#*.} + DATETIME=${DATETIME%.*} # write a line with all required info that is prefixed # with a sortable time stamp for our next step... DATED="${DATED}$(date -r ${DATETIME} '+%Y-%m-%dT%H:%M:%S').${SUBSEC} ${DATETIME} ${BACKUP} diff --git a/src/www/guiconfig.inc b/src/www/guiconfig.inc index 167a90b65..b7bd57783 100644 --- a/src/www/guiconfig.inc +++ b/src/www/guiconfig.inc @@ -67,7 +67,6 @@ $lang_encoding = $lang . '.UTF-8'; $textdomain = 'OPNsense'; putenv('LANG=' . $lang_encoding); -setlocale(LC_ALL, $lang_encoding); textdomain($textdomain); bindtextdomain($textdomain, '/usr/local/share/locale'); bind_textdomain_codeset($textdomain, $lang_encoding); diff --git a/src/www/widgets/api/plugins/traffic.inc b/src/www/widgets/api/plugins/traffic.inc index 4003d23d7..e4632ebdc 100644 --- a/src/www/widgets/api/plugins/traffic.inc +++ b/src/www/widgets/api/plugins/traffic.inc @@ -30,7 +30,8 @@ function traffic_api() global $config; $result = array(); $result['interfaces'] = legacy_interface_stats(); - $result['time'] = time(); + $temp = gettimeofday(); + $result['time'] = (double)$temp["sec"] + (double)$temp["usec"] / 1000000.0; // collect user friendly interface names foreach (legacy_config_get_interfaces(array("virtual" => false)) as $interfaceKey => $interfaceData) { if (array_key_exists($interfaceData['if'], $result['interfaces'])) {