diff options
author | einhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46> | 2007-09-10 23:08:29 +0000 |
---|---|---|
committer | einhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46> | 2007-09-10 23:08:29 +0000 |
commit | ca36c789c4284f53f61e6c308c6928f8bdc51bb4 (patch) | |
tree | aa26b791ccb9b953dd74ae3e87312fdca2e93bdd | |
parent | 74afbb457aac6a1f6e2d4a2357768f710977a640 (diff) |
Adding is_nan tests to the number parsers
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1558 4979c152-3d1c-0410-bac9-87ea11338e46
-rwxr-xr-x | LedgerSMB.pm | 3 | ||||
-rw-r--r-- | LedgerSMB/Form.pm | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/LedgerSMB.pm b/LedgerSMB.pm index 37652d5b..f61ae9a8 100755 --- a/LedgerSMB.pm +++ b/LedgerSMB.pm @@ -507,6 +507,9 @@ sub parse_amount { } $amount =~ s/\s?CR//; $amount = new Math::BigFloat($amount); + if ($amount->is_nan){ + $self->error("Invalid number detected during parsing"); + } return ( $amount * 1 ); } diff --git a/LedgerSMB/Form.pm b/LedgerSMB/Form.pm index 920870ca..60d0ec19 100644 --- a/LedgerSMB/Form.pm +++ b/LedgerSMB/Form.pm @@ -793,6 +793,9 @@ sub parse_amount { my $decimalplaces = length $1 + length $2; $amount = new Math::BigFloat($amount); + if ($amount->is_nan){ + $self->error("Invalid number detected during parsing"); + } return ( $amount * 1 ); } |