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
This commit is contained in:
2016-09-01 14:37:08 +00:00
parent a1922c30f2
commit 8b2a64d649

View File

@@ -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 */