Filter incorrectly sets entire path to lowercase

Created on 22 March 2024, 9 months ago

Problem/Motivation

If an absolute URL contains uppercase characters, such as a Filename in path, then the resulting relative path is entirely lowercased leading to a broken URL.

Steps to reproduce

Assumption: convert_url_filter module installed and configured with relevant hosts values.

  1. Edit a node's with formatted text field
  2. Insert link with absolute href, for example: https://en.wikipedia.org/wiki/American_Bank_Note_Company_Printing_Plant#/media/File:Amer_Bank_Note_Lafayette_Av_&_Baretto_St_sun_jeh.jpg (requires en.wikipedia.org added to Hosts in Text Format settings)
  3. Save node
  4. Link href is now https://en.wikipedia.org/wiki/american_bank_note_company_printing_plant#/media/file:amer_bank_note_lafayette_av_&_baretto_st_sun_jeh.jpg which no longer returns the relevant resource.

Proposed resolution

Only set url's host component to lowercase when doing comparison

πŸ› Bug report
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡«πŸ‡·France waako Normandie

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024