Skip to content

Commit

Permalink
replace POST superglobal with global variable
Browse files Browse the repository at this point in the history
  • Loading branch information
creme332 committed May 16, 2024
1 parent 75645d1 commit 46541e0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/views/Register.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

/**
* Form for entering user details.
* @var bool $form_submitted Whether form was just submitted
* @var bool $editMode Whether form is being used for editing
* @var string $defaultFirstName
* @var string $defaultLastName
Expand All @@ -26,10 +27,10 @@
* @param $input_name string value in name attribute of input tag
* @return string
*/
$ariaInvalid = function (string $input_name) use ($errors) {
$ariaInvalid = function (string $input_name) use ($errors, $form_submitted) {
// if form is loaded for the first time (form has not been submitted)
// do not add aria-invalid attribute
if (!isset($_POST['form_submit'])) {
if (!$form_submitted) {
return '';
}

Expand Down

0 comments on commit 46541e0

Please sign in to comment.