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

Block Directory: Update the regular expression that determines whether the plugin is using an img URL or an icon slug. #19316

Conversation

@StevenDufresne
Copy link
Contributor

StevenDufresne commented Dec 24, 2019

Description

The block directory API returns either an icon slug or a URL for the plugin's icon. This PR changes the regular expression to allow for an optional query string after the image URL. A detailed explanation of the issue can be found here: #19264 .

Fixes: #19264

How has this been tested?

Unit tests have been added to test this change.

Currently testing 3 cases:

  • icon: https://ps.w.org/listicles/assets/icon-128x128.png
  • icon: https://ps.w.org/listicles/assets/icon-128x128.png?rev=2011672&test=234234
  • icon: block-default

Types of changes

This is a bug fix. The current regular expression does not account for a query string being added by the CDN serving the plugins and its assets. Read more here: #19264

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.
  • I've updated all React Native files affected by any refactorings/renamings in this PR. .
@mkaz
mkaz approved these changes Dec 29, 2019
Copy link
Member

mkaz left a comment

Looks good 👍
Thanks for including the tests, makes it easier to test and confirm

@mkaz mkaz merged commit 1dbcbb2 into WordPress:master Dec 29, 2019
2 checks passed
2 checks passed
pull-request-automation
Details
Travis CI - Pull Request Build Passed
Details
@youknowriad youknowriad added this to the Gutenberg 7.2 milestone Jan 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.