Problem/Motivation
I had to use protocol-less URL in my content and drupal allowed me to save my content without giving any errors and not even a log message.
After saving I checked my node and clicked in the link I've just created. The page loops to itself.
STEPS to reproduce:
- Add field of the type 'link' in article content type
- Add a content of the type 'Article'
- In the link field, add a link like: '//www.google.com'
- Hit save and check the node
- Click on the link saved
Actual result:
The link redirects to the page itself.
OBS: I noticed the problem on 8.3.4 version. We could check if the problem exists on dev version.
Proposed resolution
Given that Link module in D7 doesn't allow you to use protocol-less urls, and a error are displayed to the user, we could add this to D8 also. Think about people that doesn't know about protocol-less and are trying to use in their contents, if they don't check the link properly, the link will redirects to the nade itself. So , if it's prossible:
a) Add a drupal error saying to the users that he can't use those kinds of URLs, or
b) Allow the use of these URLs.
And we could add a event log to the log messages.
Comment | File | Size | Author |
---|---|---|---|
#3 | evidence.png | 63.85 KB | Yago Elias |
#2 | vokoscreen-2017-06-26_09-41-01_0-426.gif | 9.11 MB | Yago Elias |
Comments
Comment #2
Yago Elias CreditAttribution: Yago Elias as a volunteer and at CI&T commentedComment #3
Yago Elias CreditAttribution: Yago Elias as a volunteer and at CI&T commentedLog is clean.
Comment #8
quietone CreditAttribution: quietone at PreviousNext 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