Skip to content
Snippets Groups Projects
Commit 8ff8fffc authored by Demian Katz's avatar Demian Katz
Browse files

Tolerate missing int_curr_symbol in locale information.

- Useful, for example, in Ubuntu, when a locale has not yet been created with locale-gen.
parent 42cbeb07
No related merge requests found
...@@ -69,9 +69,9 @@ class SafeMoneyFormat extends AbstractHelper ...@@ -69,9 +69,9 @@ class SafeMoneyFormat extends AbstractHelper
if (null === $defaultCurrency) { if (null === $defaultCurrency) {
$localeInfo = localeconv(); $localeInfo = localeconv();
$defaultCurrency = isset($localeInfo['int_curr_symbol']) $defaultCurrency = isset($localeInfo['int_curr_symbol'])
? $localeInfo['int_curr_symbol'] : 'USD'; ? trim($localeInfo['int_curr_symbol']) : '';
} }
$this->defaultCurrency = trim($defaultCurrency); $this->defaultCurrency = empty($defaultCurrency) ? 'USD' : $defaultCurrency;
} }
/** /**
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment