Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHPCS for Datepicker and Checkboxes templates #530

Merged
merged 3 commits into from
Sep 2, 2016
Merged

Conversation

dlh01
Copy link
Member

@dlh01 dlh01 commented Sep 2, 2016

See #271.

Fixes:

- Generic.Files.EndFileNewline.NotFound
- Squiz.Commenting.FileComment.Missing
- Squiz.ControlStructures.ControlSignature.SpaceAfterCloseParenthesis
- WordPress.WhiteSpace.ControlStructureSpacing.NoSpaceBetweenStructureColon
- WordPress.WhiteSpace.OperatorSpacing.NoSpaceAfter
- WordPress.XSS.EscapeOutput.OutputNotEscaped
Corrects double-escaping of the ID attribute and adds escaping to the
'checked' attribute.

Fixes:

- Generic.Files.EndFileNewline.NotFound
- Squiz.Commenting.FileComment.Missing
- Squiz.Strings.DoubleQuoteUsage.NotRequired
- WordPress.XSS.EscapeOutput.OutputNotEscaped
<?php echo $this->get_element_attributes(); ?>
<?php echo $this->option_selected( $data_row['value'], $value, "checked" ); ?>
<?php echo $this->get_element_attributes(); // Escaped interally. xss ok. ?>
<?php echo esc_attr( $this->option_selected( $data_row['value'], $value, 'checked' ) ); ?>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think this would output like, checked=&quot;checked&quot;, right?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While I admit I didn't consider that possibility, as far as I can tell this returns just checked, not checked="checked".

@nschoenholtz
Copy link
Contributor

One concern (which if accurate, seems to reflect a missing unit test heh), otherwise yayyy ☑️

@dlh01 dlh01 merged commit 6bb0972 into master Sep 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants