- πΊπΈUnited States dcam
The issue still exists in D11, though now the link isn't rendered at all. This is caused by
LinkWidget
assuming that any URL with no scheme is internal. There is no check for protocol-relative URLs. - First commit to issue fork.
- @riyas_nr opened merge request.
Allowed 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.- πΊπΈUnited States dcam
The one thing that concerned me was the "typo" cases where someone accidentally starts an internal path with a double slash. I tested these manually:
//
- Before the fix an
InvalidArgumentException
is caught byLinkTypeConstraintValidator
and the validation fails. - After the fix the same thing occurs. So there's no change in behavior.
- Before the fix an
//example
- Before the fix the problem as described in the issue summary occurs.
- After the fix the URL is treated as external, just like complete URLs.
I'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.
- πΊπΈUnited States dcam
There's a duplicate feature request issue, β¨ Link field should accept protocol-relative URLs Needs work .