-
Notifications
You must be signed in to change notification settings - Fork 146
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 galleries without schema creates relative links #747
Comments
Hm, I'm not sure I'd consider this a bug; dot characters are valid in URL paths (think of versioned API URLs), so the presence of a dot doesn't mean we aren't referring to a relative path. Maybe the "fix" is a description in the Link Settings section specifying that the schema needs to be explicit for links to other domains? |
Yeah, I'm not suggesting that. I only think a user will expect an absolute URL in most of the scenarios. Note that absolute URLs will work for linking to internal pages too (the input allows to search for any blog page/post and it'll use the absolute URL). So maybe it'll be simpler (from a user perspective) if the plugin assumes all the URLs are absolute and append the schema when not entered. |
Appreciate the report. Does the core Gallery Block behave the same way? |
@richtabor AFAIK the core Gallery Block doesn't allow to link images to custom URLs. |
🤔 Actually, the core image block does allow it and has the same behavior. Reported there as well: WordPress/gutenberg#17155 Are the CoBlocks galleries using the same tool for linking the images? |
Ahhhh I see now. We are for the most part, but I've added the custom URL functionality as that doesn't exist in core. |
@mmtr Thanks for submitting the issue. However this does seem to be a behavior of core. I see you've already reported the issue to core so I'd like to close this one in favor of that one. The effort is best spent there and inherited by everyone. For reference, closing this in favor of WordPress/gutenberg#17155 |
Describe the bug
The custom URLs entered in the gallery images are not being sanitized / validated, so entering an URL without the schema (
http(s)://
) will create a relative URL.To Reproduce
godaddy.com
).Expected behavior
To be taken to the external website upon clicking the gallery image, but instead you're taken to an internal path (i.e.
example.com/2019/08/17/my-post/godaddy.com
).Isolating the problem:
WordPress Version
5.2
Gutenberg Version
6.3.0
The text was updated successfully, but these errors were encountered: