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

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. .

Copy link
Member

@mkaz mkaz left a comment

Choose a reason for hiding this comment

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

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
@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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Block Directory: Image Icon does not show up if query string is appended to image icon url.
3 participants