diff options
author | M <m@lfurio.us> | 2015-12-06 00:12:16 -0500 |
---|---|---|
committer | M <m@lfurio.us> | 2015-12-06 00:12:16 -0500 |
commit | e6f3bf746fbb1d4c768a1d43e2a0233d0fb25f47 (patch) | |
tree | af35e8071c5890f4e84c231391bf592758883fb5 /app | |
parent | 182ec782d61749ca67bf0cd9e67821849fc29584 (diff) | |
download | scrott-e6f3bf746fbb1d4c768a1d43e2a0233d0fb25f47.tar.gz scrott-e6f3bf746fbb1d4c768a1d43e2a0233d0fb25f47.zip |
* Bug fix in Form class - populate function -- If a field was set in $input, but equal to "", the isset check would not behave as expected
Diffstat (limited to 'app')
-rw-r--r-- | app/class/form.class.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/app/class/form.class.php b/app/class/form.class.php index e50876d..d3af399 100644 --- a/app/class/form.class.php +++ b/app/class/form.class.php @@ -100,7 +100,7 @@ class Form /* init text fields */ foreach ($this->textFields as $fld) { - if (isset($input[$fld['name']])) + if (isset($input[$fld['name']]) && $input[$fld['name']] != "") $this->$fld['name'] = htmlEntities($input[$fld['name']], ENT_QUOTES); else if (!is_null($fld['deflt'])) @@ -113,7 +113,7 @@ class Form /* init numeric fields */ foreach ($this->numbFields as $fld) { - if (isset($input[$fld['name']])) + if (isset($input[$fld['name']]) && $input[$fld['name']] != "") { if (!is_numeric($input[$fld['name']])) { @@ -152,7 +152,7 @@ class Form /* init enum fields */ foreach ($this->enumFields as $fld) { - if (isset($input[$fld['name']])) + if (isset($input[$fld['name']]) && $input[$fld['name']] != "") { if (array_search($input[$fld['name']], $fld['vals']) === false) { |