From 50e3307f005ddcac59698ea125174649c3edf2e2 Mon Sep 17 00:00:00 2001 From: spiliot Date: Fri, 19 Apr 2013 01:58:08 +0300 Subject: [PATCH] Money validation accepts one decimal place --- lib/Cake/Utility/Validation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Cake/Utility/Validation.php b/lib/Cake/Utility/Validation.php index accd571df..735f7d94a 100644 --- a/lib/Cake/Utility/Validation.php +++ b/lib/Cake/Utility/Validation.php @@ -528,7 +528,7 @@ class Validation { * @return boolean Success */ public static function money($check, $symbolPosition = 'left') { - $money = '(?!0,?\d)(?:\d{1,3}(?:([, .])\d{3})?(?:\1\d{3})*|(?:\d+))((?!\1)[,.]\d{2})?'; + $money = '(?!0,?\d)(?:\d{1,3}(?:([, .])\d{3})?(?:\1\d{3})*|(?:\d+))((?!\1)[,.]\d{1})?'; if ($symbolPosition === 'right') { $regex = '/^' . $money . '(?