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:
10
form.php
10
form.php
@@ -122,6 +122,14 @@ class form
|
|||||||
// Remove the field CSRF : can not be used outside the form
|
// Remove the field CSRF : can not be used outside the form
|
||||||
unset ($values[$this->csrfField]);
|
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;
|
return $values;
|
||||||
}
|
}
|
||||||
@@ -337,7 +345,7 @@ class form
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** the definition of a formfield */
|
/** The definition of a formfield */
|
||||||
class formfield
|
class formfield
|
||||||
{
|
{
|
||||||
/** The form name */
|
/** The form name */
|
||||||
|
|||||||
Reference in New Issue
Block a user