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

URL Details: Avoid PHP notice when parsing protocol-relative icon URLs #33779

Merged
merged 1 commit into from
Jul 30, 2021

Conversation

Mamaduka
Copy link
Member

@Mamaduka Mamaduka commented Jul 30, 2021

Description

Sites might use protocol-relative URLs for icons. When a similar URL is parsed with parse_url, it doesn't return schema and triggered PHP notice.

Example: https://3v4l.org/SFEiZ

How has this been tested?

  1. Create a post.
  2. Add a paragraph with a link to https://twitter.com/
  3. Display rich URL preview.
  4. WP shouldn't log the PHP Notice: Undefined index: scheme message.

Types of changes

Bugfix

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • I've tested my changes with keyboard and screen readers.
  • 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 (please manually search all *.native.js files for terms that need renaming or removal).

@Mamaduka Mamaduka added [Type] Bug An existing feature does not function as intended [Feature] Link Editing Link components (LinkControl, URLInput) and integrations (RichText link formatting) labels Jul 30, 2021
@Mamaduka Mamaduka requested a review from getdave July 30, 2021 12:09
@Mamaduka Mamaduka self-assigned this Jul 30, 2021
@Mamaduka Mamaduka requested a review from hellofromtonya July 30, 2021 13:52
Copy link
Contributor

@getdave getdave left a comment

Choose a reason for hiding this comment

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

Nice catch thanks!

@Mamaduka Mamaduka merged commit 2b1a1d7 into trunk Jul 30, 2021
@Mamaduka Mamaduka deleted the fix/undefined-index-schema branch July 30, 2021 14:13
@github-actions github-actions bot added this to the Gutenberg 11.3 milestone Jul 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Link Editing Link components (LinkControl, URLInput) and integrations (RichText link formatting) [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants