summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xLedgerSMB.pm3
-rw-r--r--LedgerSMB/Form.pm3
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 );
}