[-] Bo : Fix #PSCFV-9306 report of #PSCFI-7115 Add a new specific price = faulty validation
This commit is contained in:
@@ -229,7 +229,7 @@ class ValidateCore
|
||||
*/
|
||||
public static function isPrice($price)
|
||||
{
|
||||
return preg_match('/^[0-9]{1,10}(\.[0-9]{1,9})?$/', $price);
|
||||
return preg_match('/^[0-9]{1,10}(\.[0-9]{1,9})?$/', sprintf('%f', $price));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -240,7 +240,7 @@ class ValidateCore
|
||||
*/
|
||||
public static function isNegativePrice($price)
|
||||
{
|
||||
return preg_match('/^[-]?[0-9]{1,10}(\.[0-9]{1,9})?$/', $price);
|
||||
return preg_match('/^[-]?[0-9]{1,10}(\.[0-9]{1,9})?$/', sprintf('%f', $price));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user