[-] Bo : Fix #PSCFV-9306 report of #PSCFI-7115 Add a new specific price = faulty validation

This commit is contained in:
gRoussac
2013-05-31 18:10:41 +02:00
parent f84e8331de
commit ff2c3725d3
2 changed files with 11 additions and 6 deletions
+2 -2
View File
@@ -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));
}
/**