Permalink
Browse files

Money validation accepts one decimal place

  • Loading branch information...
1 parent d01d291 commit 50e3307f005ddcac59698ea125174649c3edf2e2 @spiliot spiliot committed Apr 18, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/Cake/Utility/Validation.php
@@ -528,7 +528,7 @@ public static function maxLength($check, $max) {
* @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 . '(?<!\x{00a2})\p{Sc}?$/u';
} else {

0 comments on commit 50e3307

Please sign in to comment.