Revision 53d05e1f
Von Moritz Bunkus vor fast 9 Jahren hinzugefügt
SL/Form.pm | ||
---|---|---|
947 | 947 |
|
948 | 948 |
# Make sure no code wich is not a math expression ends up in eval(). |
949 | 949 |
return 0 unless $amount =~ /^ [\s \d \( \) \- \+ \* \/ \. ]* $/x; |
950 |
|
|
951 |
# Prevent numbers from being parsed as octals; |
|
952 |
$amount =~ s{ (?<! [\d.] ) 0+ (?= [1-9] ) }{}gx; |
|
953 |
|
|
950 | 954 |
return scalar(eval($amount)) * 1 ; |
951 | 955 |
} |
952 | 956 |
|
Auch abrufbar als: Unified diff
Form::parse_amount: Parsen als Oktalzahlen verhindern