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

Fix URL protocol validation and parsing attribute values with multiple URLs #1411

Merged
merged 1 commit into from
Sep 7, 2018

Conversation

westonruter
Copy link
Member

This is a follow-up on #983 to fix two problems:

  1. URL protocol validation was failing when a URL contained a colon, as the plugin was incorrectly assuming everything before it was the scheme. The characters being checked for in the protocol were also incorrect.
  2. URLs with commas were incorrectly raising validation errors. Attribute values containing URLs were always getting split by commas to handle the srcset case. However, this attribute is the only one that contains a comma-separated list of URLs (among other descriptors), so it doesn't make sense to split every attribute value by commas. This ensures that a URL containing a latitude and longitude separated by a comma won't require its comma to be URL-encoded as %2C to avoid sanitization.

Fixes #1410.

@westonruter westonruter added this to the v1.0 milestone Sep 7, 2018
Copy link
Member

@amedina amedina left a comment

Choose a reason for hiding this comment

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

Good changes; resulting in more modular and legible code.

@westonruter westonruter force-pushed the fix/url-attribute-list-handling branch from 30722b2 to 93d77d0 Compare September 7, 2018 23:26
@westonruter westonruter merged commit 60fe637 into develop Sep 7, 2018
@westonruter westonruter deleted the fix/url-attribute-list-handling branch September 7, 2018 23:32
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.

Problem with amp-iframe
2 participants