Link field double-escapes relative URL spaces.

Created on 29 July 2019, over 5 years ago
Updated 23 February 2023, over 1 year ago

I have an entity with a field that is field type of Link. If I have the field settings so that "Validate URL" is turned off, a relative URL containing spaces will change the spaces to %2520 instead of %20 (escaping % after escaping spaces), causing the URL to be incorrect.

If I link to sites/default/files/associated_files/My Doc.pdf, it becomes sites/default/files/associated_files/My%2520Doc.pdf.

If I link to sites/default/files/associated_files/My%20Doc.pdf it becomes sites/default/files/associated_files/My%252520Doc.pdf.

If I enter absolute URLs, it works as it should, working for whichever way I enter it (spaces or %20).

I have the Absolute URL setting unchecked.

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇩🇪Germany Anybody Porta Westfalica

    Funny, I'm just running into the same issue in Drupal 9.5... :D Looking for an issue, but just found this one for Drupal 7.

Production build 0.71.5 2024