From 0818c9bbfc9408ced17ef8d1486f4d13d159d82d Mon Sep 17 00:00:00 2001 From: Carsten Brandt Date: Wed, 1 Oct 2014 00:46:28 +0200 Subject: [PATCH] do not override config when intl is not installed fixes #5260 --- framework/CHANGELOG.md | 1 + framework/i18n/Formatter.php | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/framework/CHANGELOG.md b/framework/CHANGELOG.md index eabd0fd1e5..5fea5f0aa6 100644 --- a/framework/CHANGELOG.md +++ b/framework/CHANGELOG.md @@ -4,6 +4,7 @@ Yii Framework 2 Change Log 2.0.0 under development ----------------------- +- Bug #5260: `yii\i18n\Formatter::decimalSeparator` and `yii\i18n\Formatter::thousandSeparator` where not configurable when intl is not installed (execut, cebe) - Bug: Date and time formatting now assumes UTC as the timezone for input dates unless a timezone is explicitly given (cebe) - Enh #4275: Added `removeChildren()` to `yii\rbac\ManagerInterface` and implementations (samdark) diff --git a/framework/i18n/Formatter.php b/framework/i18n/Formatter.php index 3837ecc5d5..ea36c0d891 100644 --- a/framework/i18n/Formatter.php +++ b/framework/i18n/Formatter.php @@ -208,8 +208,12 @@ class Formatter extends Component } $this->_intlLoaded = extension_loaded('intl'); if (!$this->_intlLoaded) { - $this->decimalSeparator = '.'; - $this->thousandSeparator = ','; + if ($this->decimalSeparator === null) { + $this->decimalSeparator = '.'; + } + if ($this->thousandSeparator === null) { + $this->thousandSeparator = ','; + } } }