Dots in query parameter names converted to underscores

Created on 6 July 2018, almost 6 years ago
Updated 23 April 2024, about 1 month ago

When adding an external link to a menu, dots in query parameter names are converted to underscores, even though dots are allowed in query parameter names in general. This is a confusing experience for site owners trying to create links to external sites, the link is accepted, but its rendered differently.

This seems to be because Symfony uses parse_str() to convert parameters to PHP safe variable names. See https://github.com/symfony/symfony/issues/25541 It would be ideal for this to be fixed by PHP or Symfony instead of Drupal. However, it seems there's not much movement in that direction. Therefore, it could make sense for Symfony, or Drupal, to have a function used to parse_str for the scenario of rendering links to other sites.

To reproduce:

  1. From any installation of Drupal
  2. Add an external link to the main menu (https://www.drupal.org?first.name=Aaron&last.name=Wolfe)
  3. Expected behavior: The url in the menu link should be https://www.drupal.org?first.name=Aaron&last.name=Wolfe
  4. Actual behavior: Instead, the menu item links to https://www.drupal.org?first_name=Aaron&last_name=Wolfe

This also happens with redirects, and I imagine any other place that prepares URLs with query strings.

πŸ› Bug report
Status

Needs work

Version

11.0 πŸ”₯

Component
Menu systemΒ  β†’

Last updated 4 days ago

Created by

πŸ‡ΊπŸ‡ΈUnited States awolfey

Live updates comments and jobs are added and updated live.
  • Needs subsystem maintainer review

    It is used to alert the maintainer(s) of a particular core subsystem that an issue significantly impacts their subsystem, and their signoff is needed (see the governance policy draft for more information). Also, if you use this tag, make sure the issue component is set to the correct subsystem. If an issue significantly impacts more than one subsystem, use needs framework manager review instead.

Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

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

Production build 0.69.0 2024