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

ProperEscapingFunction: further improve attribute matching #681

Merged
merged 1 commit into from
Apr 26, 2021

Conversation

jrfnl
Copy link
Collaborator

@jrfnl jrfnl commented Apr 24, 2021

Prior to VIPCS 2.3.0, equal signs not followed by quotes were ignored by this sniff, even though unquoted values for attributes in HTML is supported as long as the value does not contain whitespace.

However, detecting equal signs not followed by quotes could confuse the attribute detecting as equal signs without quotes can also be used outside of HTML attribute context.

This improves the attribute detection further by making sure that an equal sign (with or without subsequent quotes) is preceded by at least one alphanumeric character to indicate it could be an HTML attribute.

Includes tests.

Fixes #680

Prior to VIPCS 2.3.0, equal signs not followed by quotes were ignored by this sniff, even though unquoted values for attributes in HTML is supported as long as the value does not contain whitespace.

However, detecting equal signs not followed by quotes could confuse the attribute detecting as equal signs without quotes can also be used outside of HTML attribute context.

This improves the attribute detection further by making sure that an equal sign (with or without subsequent quotes) is preceded by at least one alphanumeric character to indicate it _could_ be an HTML attribute.

Includes tests.

Fixes 680
@jrfnl jrfnl added this to the 2.3.2 milestone Apr 24, 2021
@jrfnl jrfnl requested a review from a team as a code owner April 24, 2021 21:26
@jrfnl jrfnl mentioned this pull request Apr 24, 2021
2 tasks
Copy link
Contributor

@rebeccahum rebeccahum left a comment

Choose a reason for hiding this comment

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

🥇

@rebeccahum rebeccahum merged commit b40582c into develop Apr 26, 2021
@rebeccahum rebeccahum deleted the fix/680-properescapingfunctions-match-precision branch April 26, 2021 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

False positive htmlAttrNotByEscHTML
2 participants