From e6f3bf746fbb1d4c768a1d43e2a0233d0fb25f47 Mon Sep 17 00:00:00 2001 From: M Date: Sun, 6 Dec 2015 00:12:16 -0500 Subject: * 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 --- app/class/form.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'app') 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) { -- cgit v1.2.3