Commit ea8a62c3 authored by Nigel McNie's avatar Nigel McNie Committed by Nigel McNie

Make sure that hidden elements only retrieve their values from the

element themselves, rather than GET/POST
parent 275b81cd
......@@ -32,6 +32,9 @@
* @return string The HTML for the element
*/
function pieform_element_hidden($element, Pieform $form) {
if (!isset($element['value'])) {
throw new PieformException('The hidden element "' . $element['name'] . '" must have a value set');
}
$value = $form->get_value($element);
if (is_array($value)) {
$result = '';
......@@ -46,4 +49,12 @@ function pieform_element_hidden($element, Pieform $form) {
. ' value="' . Pieform::hsc($form->get_value($element)) . "\">\n";
}
/**
* Returns the value for a hidden element. Hidden elements only listen to the
* 'value' index, and not to GET/POST
*/
function pieform_element_hidden_get_value(Pieform $form, $element) {
return $element['value'];
}
?>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment