From 8b2a64d649612d88d3a2726f11616ece3e74b722 Mon Sep 17 00:00:00 2001 From: Dominique Fournier Date: Thu, 1 Sep 2016 14:37:08 +0000 Subject: [PATCH] BUG form->values () : must overwrite readonly and hidden fields (the user can modify them, but it is not allowed) git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@3021 bf3deb0d-5f1a-0410-827f-c0cc1f45334c --- form.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/form.php b/form.php index 5732429..8a20f21 100644 --- a/form.php +++ b/form.php @@ -122,6 +122,14 @@ class form // Remove the field CSRF : can not be used outside the form unset ($values[$this->csrfField]); } + if (isset ($_SESSION["domframework"]["form"]["fields"])) + { + foreach ($_SESSION["domframework"]["form"]["fields"] as $field) + { + if ($field->type === "hidden" || $field->readonly !== null) + $values[$field->name] = $field->defaults; + } + } return $values; } @@ -337,7 +345,7 @@ class form } } -/** the definition of a formfield */ +/** The definition of a formfield */ class formfield { /** The form name */