Skip to content

Commit dc63f16

Browse files
committed
AC-13855: Penny rounding error in catalog rule
Fix: Information Exposure in PHP
1 parent 9ed73a8 commit dc63f16

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

app/code/Magento/Directory/Model/PriceCurrency.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,6 @@ protected function getStore($scope = null)
140140
$scope = $this->storeManager->getStore($scope);
141141
}
142142
} catch (\Exception $e) {
143-
$this->logger->critical($e);
144143
$scope = $this->storeManager->getStore();
145144
}
146145

@@ -153,7 +152,7 @@ protected function getStore($scope = null)
153152
public function round($price)
154153
{
155154
// To fix rounding error in PHP 8.4
156-
if (str_contains(PHP_VERSION, '8.4')) {
155+
if (version_compare(PHP_VERSION, '8.4', '>=')) {
157156
return round((float)sprintf("%.3f", $price), 2);
158157
}
159158
return round((float) $price, 2);

0 commit comments

Comments
 (0)