X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=includes%2Fdata_checks.inc;h=ff316953030d9c322fea21c2a7e3aced11717340;hb=dc98038dfc9d5a6d54ffe6566bc566a433e59ccb;hp=9589f13c9e60d181db3d8b3abef14017c0690969;hpb=687857391fcb528f5a38e2c7f3d9eb4c63b4a1d2;p=fa-stable.git diff --git a/includes/data_checks.inc b/includes/data_checks.inc index 9589f13c..ff316953 100644 --- a/includes/data_checks.inc +++ b/includes/data_checks.inc @@ -470,11 +470,12 @@ function check_int($postname, $min=null, $max=null) { // // Numeric input check. // Return 1 if number has proper form and is within range +// Empty/not defined fields are defaulted to $dflt value. // -function check_num($postname, $min=null, $max=null) { +function check_num($postname, $min=null, $max=null, $dflt=0) { if(!isset($_POST[$postname])) return 0; - $num = input_num($postname); + $num = input_num($postname, $dflt); if ($num === false || $num === null) return 0; if (isset($min) && ($num<$min))