View Issue Details

IDProjectCategoryView StatusLast Update
0006084OXID eShop (all versions)1.02. Price calculations (discounts, coupons, additional costs etc.)public2024-01-24 08:26
Reportertjungcl Assigned To 
PrioritylowSeverityminorReproducibilityalways
Status confirmedResolutionopen 
Product Version6.4.0 
Summary0006084: oxprice smarty plugin not working with german number format
Descriptionif the new oxprice tag gets a price parameter in German number format "12,34", for example from the (deprecated) formatCurrency function from some old module, the result is an empty string.

So, it does not happen, if everything is purely numeric.
A check whether $sPrice is not numerical but can be parsed in the current languages number format would help in all other cases.
TagsNo tags attached.
ThemeAll
BrowserAll
PHP VersionNot defined
Database VersionNot defined

Activities

SvenBrunk

2022-01-28 17:07

administrator   ~0013561

This is now no longer the case. Instead

https://github.com/OXID-eSales/oxideshop_ce/blob/712f4826d2190c33ad712ee028f5feb582d13133/source/Core/Smarty/Plugin/function.oxprice.php#L37

would now cut the given price...

php > echo floatval("12,34");
12
php > echo floatval("12.34");
12.34

At that point it is also not even clear what the correct decimal separator would be and the default would be used. This makes floatval especially dangerous.
Severity only left at minor as this should not happen with current code using the Price object. Nonetheless this might be an additional problem for legacy code.