From 6a8d3a8e5ca7677d19ae574964b2f0925f992d9a Mon Sep 17 00:00:00 2001 From: Ere Maijala <ere.maijala@helsinki.fi> Date: Thu, 12 Mar 2015 13:39:30 +0200 Subject: [PATCH] Tweaked ICU workaround in SafeMoneyFormat to only touch LC_NUMERIC as the value of LC_ALL could become too long for setlocale() to handle in the end. --- .../VuFind/src/VuFind/View/Helper/Root/SafeMoneyFormat.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/module/VuFind/src/VuFind/View/Helper/Root/SafeMoneyFormat.php b/module/VuFind/src/VuFind/View/Helper/Root/SafeMoneyFormat.php index 874cad99f48..9cf1064a57e 100644 --- a/module/VuFind/src/VuFind/View/Helper/Root/SafeMoneyFormat.php +++ b/module/VuFind/src/VuFind/View/Helper/Root/SafeMoneyFormat.php @@ -91,12 +91,12 @@ class SafeMoneyFormat extends AbstractHelper // Workaround for a problem in ICU library < 4.9 causing formatCurrency to // fail if locale has comma as a decimal separator. // (see https://bugs.php.net/bug.php?id=54538) - $locale = setlocale(LC_ALL, 0); - setlocale(LC_ALL, ['en_us.UTF-8', 'en_us.UTF8', 'en_us']); + $locale = setlocale(LC_NUMERIC, 0); + setlocale(LC_NUMERIC, ['en_us.UTF-8', 'en_us.UTF8', 'en_us']); $result = $escaper( $this->formatter->formatCurrency((float)$number, $currency) ); - setlocale(LC_ALL, $locale); + setlocale(LC_NUMERIC, $locale); return $result; } } -- GitLab