Commit 36ca25fd authored by Nigel McNie's avatar Nigel McNie
Browse files

Fix a couple of bugs in the password element:

* Check for the 'value' of the element before the submitted value
* Only check the submitted value if the form is submitted. Previously,
  only the 'value' was being checked if the form was submitted, which
  was completely wrong.
parent 26049b7b
......@@ -38,13 +38,13 @@ function pieform_element_password(Pieform $form, $element) {/*{{{*/
}/*}}}*/
function pieform_element_password_get_value(Pieform $form, $element) {/*{{{*/
if (isset($element['value'])) {
return $element['value'];
}
$global = ($form->get_property('method') == 'get') ? $_GET : $_POST;
if (isset($global[$element['name']])) {
if ($form->is_submitted() && isset($global[$element['name']])) {
return $global[$element['name']];
}
if ($form->is_submitted() && isset($element['value'])) {
return $element['value'];
}
return null;
}/*}}}*/
......
Supports Markdown
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