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

Image links opening new windows do not get rel=nooopener security feature #20130

Closed
aardrian opened this issue Feb 9, 2020 · 1 comment
Closed

Comments

@aardrian
Copy link

aardrian commented Feb 9, 2020

Describe the bug
If I add a link to an image that opens in a new window, it does not get the rel="noreferrer noopener" attribute.

To reproduce
Steps to reproduce the behavior:

  1. Go to https://wordpress.org/gutenberg/
  2. Add an image or choose an existing image.
  3. Make the image a hyperlink to an off-site URL.
  4. Choose to Open in New Tab.
  5. Change to Edit as HTML.

Expected behavior
As with text links that open new windows, rel="noreferrer noopener" should be added to the link (since it has target="_blank"). It does not have the attribute.

Eg (screen shots below):

<a href="https://example.com/" target="_blank"><img src="https://www.fillmurray.com/300/200" alt=""/></a>

Screenshots
An image link set to open in a new window.
The HTML showing the target attribute, but no rel attribute.

Desktop

  • OS: Windows
  • Browser: Firefox 72, Chrome 79
@swissspidy swissspidy added the Needs Testing Needs further testing to be confirmed. label Feb 10, 2020
@ehti ehti removed the Needs Testing Needs further testing to be confirmed. label Mar 24, 2020
@ehti
Copy link

ehti commented Mar 24, 2020

Hey @aardrian,

After adding the link, if you check on the frontend, the rel="noopener noreferrer" attribute is actually there. Or even if you refresh the editor after saving/updating, you'll see it there.

The issue seems to be that if you immediately check its HTML source, yes, it doesn't show up in the editor. The related issue for it is #9731 so closing this one.

Thank you!

@ehti ehti closed this as completed Mar 24, 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

No branches or pull requests

3 participants