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 1 commit into from Sep 7, 2018


Copy link

@westonruter westonruter commented Sep 7, 2018

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
@westonruter westonruter requested a review from amedina Sep 7, 2018
amedina approved these changes Sep 7, 2018
Copy link

@amedina amedina left a comment

Good changes; resulting in more modular and legible code.

@westonruter westonruter force-pushed the fix/url-attribute-list-handling branch from 30722b2 to 93d77d0 Sep 7, 2018
@westonruter westonruter merged commit 60fe637 into develop Sep 7, 2018
2 checks passed
@westonruter westonruter deleted the fix/url-attribute-list-handling branch Sep 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet
Linked issues

Successfully merging this pull request may close these issues.

2 participants