mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Money validation accepts one decimal place
This commit is contained in:
parent
d01d291d13
commit
50e3307f00
1 changed files with 1 additions and 1 deletions
|
@ -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 . '(?<!\x{00a2})\p{Sc}?$/u';
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue