projects
/
fa-stable.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Rerun
[fa-stable.git]
/
includes
/
data_checks.inc
diff --git
a/includes/data_checks.inc
b/includes/data_checks.inc
index 295a353e1203d2ec1cc484291803d9e8113f7fe7..ff316953030d9c322fea21c2a7e3aced11717340 100644
(file)
--- a/
includes/data_checks.inc
+++ b/
includes/data_checks.inc
@@
-470,12
+470,13
@@
function check_int($postname, $min=null, $max=null) {
//
// Numeric input check.
// Return 1 if number has proper form and is within <min, max> range
//
// Numeric input check.
// Return 1 if number has proper form and is within <min, max> 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;
if(!isset($_POST[$postname]))
return 0;
- $num = input_num($postname);
- if ($num === false)
+ $num = input_num($postname
, $dflt
);
+ if ($num === false
|| $num === null
)
return 0;
if (isset($min) && ($num<$min))
return 0;
return 0;
if (isset($min) && ($num<$min))
return 0;