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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update regex for tag selectors #1534

Merged
merged 5 commits into from Nov 20, 2018
Merged

Update regex for tag selectors #1534

merged 5 commits into from Nov 20, 2018

Conversation

@swissspidy
Copy link
Collaborator

@swissspidy swissspidy commented Oct 25, 2018

This prevents cases where legit CSS selectors were wrongly renamed.

Props @westonruter for the fix 馃檪

Fixes #1513.

@swissspidy swissspidy requested a review from westonruter Oct 25, 2018
@swissspidy
Copy link
Collaborator Author

@swissspidy swissspidy commented Oct 25, 2018

Failing test:

1) AMP_Style_Sanitizer_Test::test_amp_selector_conversion with data set "iframe" ('<p><b>purple</b><iframe src="...e></p>', 'p>*:not(iframe){color:purple}', 'p>*:not(amp-iframe){color:purple}')
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
-'p>*:not(amp-iframe){color:purple}'
+'p>*:not(iframe){color:purple}'

@westonruter
Copy link
Member

@westonruter westonruter commented Oct 25, 2018

We'll need to add some tests.

Copy link
Member

@westonruter westonruter left a comment

And some tests needed.

includes/sanitizers/class-amp-style-sanitizer.php Outdated Show resolved Hide resolved
@westonruter westonruter changed the base branch from develop to 1.0 Nov 20, 2018
@westonruter westonruter force-pushed the fix/style-sanitizer-regex branch from 231710f to bb188ea Nov 20, 2018
@westonruter westonruter added this to the v1.0 milestone Nov 20, 2018
@westonruter westonruter force-pushed the fix/style-sanitizer-regex branch from 6e7353c to d135818 Nov 20, 2018
@westonruter westonruter force-pushed the fix/style-sanitizer-regex branch from d135818 to 2379ac5 Nov 20, 2018
@westonruter westonruter merged commit 9f3de03 into 1.0 Nov 20, 2018
2 checks passed
kienstra added a commit that referenced this issue Nov 20, 2018
This is recently merged,
thanks to swissspidy's work.
@swissspidy swissspidy deleted the fix/style-sanitizer-regex branch Nov 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants