Case sensitivity

Created on 29 January 2024, 10 months ago
Updated 16 September 2024, 2 months ago

Problem/Motivation

Case sensitivity. It seems that redirects itself managed like case-insensitive (because of using mb_strtolower() in Redirect::generateHash()). But, if we will look in redirect_path_alias_update() we will see that aliases comparing between each other like case-sensitive.

Steps to reproduce

  1. Enable "Automatically create redirects when URL aliases are changed."
  2. Create a node with alias "/TEST"
  3. Change it alias to "/TEst"
  4. Redirect loop achived :)

Proposed resolution

Treat redirects as case-sensitive. As described here - https://www.w3.org/TR/WD-html40-970708/htmlweb.html

URLs in general are case-sensitive (with the exception of machine names). There may be URLs, or parts of URLs, where case doesn't matter, but identifying these may not be easy. Users should always consider that URLs are case-sensitive.

Remaining tasks

Discuss it ¯\_(ツ)_/¯. Take a look into simple patch.

📌 Task
Status

Needs review

Version

1.0

Component

Code

Created by

🇷🇺Russia kala4ek 🇷🇺 Novosibirsk

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

Merge Requests

Comments & Activities

  • Issue created by @kala4ek
  • 🇷🇺Russia kala4ek 🇷🇺 Novosibirsk
  • First commit to issue fork.
  • Pipeline finished with Failed
    2 months ago
    Total: 726s
    #282760
  • Assigned to jasonac91
  • Status changed to Needs review 2 months ago
  • Drupal version: 10.3.2
    Php version: 8.2
    Module version: redirect 8.x-1.x-dev
    I have tried to replicate the issue but not able to reproduce the same. I have enabled "Automatically create redirects when URL aliases are changed." in the redirect settings. Created a content with url alias /TEST and then updated the url to /TEst, after this the redirects from /TEST to /TEst and it's working properly without any redirect loop.

  • 🇮🇳India sourav_paul Kolkata

    @kala4ek I've Tried to replicate the issue by following steps but can't achieve the redirect loop. Even I've tried different scenarios.
    I've tested it on Drupal 10.3.3, PHP 8.3, module dev branch: 8.x-1.x-dev.

    "Automatically create redirects when URL aliases are changed." - functionality working fine as expected.

    Attaching ss:

    Please provide proper reproducing steps...

  • 🇷🇺Russia kala4ek 🇷🇺 Novosibirsk

    Will try to reproduce it with clean installation.

Production build 0.71.5 2024