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

Custom URLs in images without schema creates relative links #17155

Closed
mmtr opened this issue Aug 23, 2019 · 3 comments
Closed

Custom URLs in images without schema creates relative links #17155

mmtr opened this issue Aug 23, 2019 · 3 comments
Labels
[Block] Image Affects the Image Block [Type] Bug An existing feature does not function as intended

Comments

@mmtr
Copy link
Contributor

mmtr commented Aug 23, 2019

Describe the bug
The custom URLs entered in an image block are not being sanitized / validated, so entering an URL without the schema (http(s)://) will create a relative URL.

To reproduce

  1. Insert an image block and upload/select an image.
  2. On the block toolbar, click on "Edit link".
  3. Enter an address without http:// or https:// (i.e. wordpress.org).
  4. Publish the page/post.
  5. Visit the published post/page.

Expected behavior
To be taken to the external website upon clicking the image, but instead you're taken to an internal path (i.e. example.com/2019/08/23/my-post/wordpress.org).

@mmtr mmtr added [Block] Image Affects the Image Block [Type] Bug An existing feature does not function as intended labels Aug 23, 2019
@paaljoachim
Copy link
Contributor

Here is another Image block issue. This is probably the 3 or 4th issue in relation to the Image block.

Pinging:
@WordPress/gutenberg-core

@paaljoachim
Copy link
Contributor

Hi @mmtr Miguel

This issue looks like a duplicate of this:
Button Block does not prefix a URL with http://
#6841

The focus in the other issue is though the Buttons block. If you can leave a comment there then we can close this issue.
Thanks.

@mmtr
Copy link
Contributor Author

mmtr commented Feb 10, 2021

@mrwweb already did that in #6841 (comment), so we can close this one as duplicate.

@mmtr mmtr closed this as completed Feb 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Image Affects the Image Block [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants