Needs work
Project:
Drupal core
Version:
main
Component:
link.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
26 Jun 2017 at 13:23 UTC
Updated:
7 Oct 2025 at 15:53 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
yago elias commentedComment #3
yago elias commentedLog is clean.

Comment #8
quietone commentedI tested on Drupal 9.4.x, standard install, and can confirm the problem still exists.
Tagging and adding to #3188110: [Meta] Improve URL validation
Comment #12
dcam commentedThe issue still exists in D11, though now the link isn't rendered at all. This is caused by
LinkWidgetassuming that any URL with no scheme is internal. There is no check for protocol-relative URLs.Comment #13
dcam commentedComment #16
riyas_nr commentedAllowed protocol-relative URLs in Link fields and updated constraints to exempt them from validation errors.
Added test coverage for protocol-relative URLs.
Moving to NR.
Comment #17
smustgrave commentedComment #18
dcam commentedThe one thing that concerned me was the "typo" cases where someone accidentally starts an internal path with a double slash. I tested these manually:
//InvalidArgumentExceptionis caught byLinkTypeConstraintValidatorand the validation fails.//exampleI've wondered whether there's any benefit to adding assertions for these cases, just so we know if there's any change in behavior. I don't know that there is, so I won't insist on it. But it's something to consider.
I think this is almost ready to go. We just need that MR comment @smustgrave made to be addressed.
Comment #19
dcam commentedComment #20
riyas_nr commentedCombined conditions and moving to NR.
Comment #21
dcam commentedThere's a duplicate feature request issue, #2744729: Link field should accept protocol-relative URLs.
Comment #22
dcam commentedComment #23
smustgrave commented@dcam should that one be closed for this or vice versa?
Comment #24
dcam commentedI think I was still trying to figure that out. Finding that other issue led to a bit of a rabbit hole of issues. There's a larger problem with external URL validation in general.
Comment #25
dcam commentedThe other feature request was closed as a duplicate.
Comment #26
dcam commentedI left feedback on the MR.