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


Copy link

StevenDufresne commented Dec 24, 2019


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:
  • icon:
  • 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


  • 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 approved these changes Dec 29, 2019
Copy link

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
Travis CI - Pull Request Build Passed
@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
None yet
3 participants
You can’t perform that action at this time.