Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Money validation accepts one decimal place

  • Loading branch information...
commit 50e3307f005ddcac59698ea125174649c3edf2e2 1 parent d01d291
@spiliot spiliot authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/Cake/Utility/Validation.php
View
2  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 {
Please sign in to comment.
Something went wrong with that request. Please try again.