]> wagnertech.de Git - mfinanz.git/blobdiff - SL/Form.pm
Form::parse_amount: Parsen als Oktalzahlen verhindern
[mfinanz.git] / SL / Form.pm
index 0aad56ef5d8ba3223a8aca856ad0e489d6b1c290..e597786ecf6395747e426e28824f4ed34dd5e639 100644 (file)
@@ -947,6 +947,10 @@ sub parse_amount {
 
   # Make sure no code wich is not a math expression ends up in eval().
   return 0 unless $amount =~ /^ [\s \d \( \) \- \+ \* \/ \. ]* $/x;
+
+  # Prevent numbers from being parsed as octals;
+  $amount =~ s{ (?<! [\d.] ) 0+ (?= [1-9] ) }{}gx;
+
   return scalar(eval($amount)) * 1 ;
 }