Skip to content

Commit ee4bc2d

Browse files
committed
Merge pull request #181 from magento-south/BUGS
[South] Bugs fixes
2 parents 2e23323 + d0fd953 commit ee4bc2d

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

lib/internal/Magento/Framework/Locale/Format.php

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,17 @@ public function getNumber($value)
8282
* Functions returns array with price formatting info
8383
*
8484
* @return array
85+
* @SuppressWarnings(PHPMD.NPathComplexity)
8586
*/
8687
public function getPriceFormat()
8788
{
88-
$numberElements = (new DataBundle())->get($this->_localeResolver->getLocale())['NumberElements'];
89-
$format = $numberElements['latn']['patterns']['currencyFormat'];
90-
$symbols = $numberElements['latn']['symbols'];
89+
$localeData = (new DataBundle())->get($this->_localeResolver->getLocale());
90+
$format = $localeData['NumberElements']['latn']['patterns']['currencyFormat']
91+
?: explode(';', $localeData['NumberPatterns'][1])[0];
92+
$decimalSymbol = $localeData['NumberElements']['latn']['symbols']['decimal']
93+
?: $localeData['NumberElements'][0];
94+
$groupSymbol = $localeData['NumberElements']['latn']['symbols']['group']
95+
?: $localeData['NumberElements'][1];
9196

9297
$pos = strpos($format, ';');
9398
if ($pos !== false) {
@@ -120,8 +125,8 @@ public function getPriceFormat()
120125
'pattern' => $this->_scopeResolver->getScope()->getCurrentCurrency()->getOutputFormat(),
121126
'precision' => $totalPrecision,
122127
'requiredPrecision' => $requiredPrecision,
123-
'decimalSymbol' => $symbols['decimal'],
124-
'groupSymbol' => $symbols['group'],
128+
'decimalSymbol' => $decimalSymbol,
129+
'groupSymbol' => $groupSymbol,
125130
'groupLength' => $group,
126131
'integerRequired' => $integerRequired,
127132
];

lib/internal/Magento/Framework/View/Template/Html/Minifier.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,8 @@ public function minify($file)
122122
'#(?<!' . implode('|', $this->inlineHtmlTags) . ')\> \<#',
123123
'><',
124124
preg_replace(
125-
'#(?ix)(?>[^\S ]\s*|\s{2,})(?=(?:(?:[^<]++|<(?!/?(?:textarea|pre|script|style)\b))*+)'
126-
. '(?:<(?>textarea|pre|script|style)\b|\z))#',
125+
'#(?ix)(?>[^\S ]\s*|\s{2,})(?=(?:(?:[^<]++|<(?!/?(?:textarea|pre|script)\b))*+)'
126+
. '(?:<(?>textarea|pre|script)\b|\z))#',
127127
' ',
128128
preg_replace(
129129
'#(?<!:|\\\\)//(?!\s*\<\!\[)(?!\s*]]\>)[^\n\r]*#',

0 commit comments

Comments
 (0)