Skip to content

Commit

Permalink
Merge pull request #551 from equalizedigital/steve/543/missing-form-l…
Browse files Browse the repository at this point in the history
…abels-strict-comparison

Missing form label rule strict comparison fix
  • Loading branch information
SteveJonesDev authored Mar 26, 2024
2 parents 8e16089 + f8927e4 commit 4b37736
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion includes/rules/missing_form_label.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ function ac_input_has_label( $field, $dom ) {
if ( $field->getAttribute( 'aria-label' ) ) {
return true;
}
if ( $dom->find( 'label[for="' . $field->getAttribute( 'id' ) . '"]', -1 ) !== '' ) {
if ( $dom->find( 'label[for="' . $field->getAttribute( 'id' ) . '"]', -1 ) !== null ) {

return true;
}
return edac_field_has_label_parent( $field );
Expand Down

0 comments on commit 4b37736

Please sign in to comment.