AliasManager->getAliasByPath('//') PHP Warning

Created on 21 May 2021, over 3 years ago
Updated 3 February 2023, almost 2 years ago

Problem/Motivation

I noticed in my logs that a referrer is using https://www.example.com// to direct users to my site. Notice the double slash. The site seems to get redirected to a single slash which is great, but the following PHP warning still occurs when AliasManager->getAliasByPath('//') is called by a contrib moduleโ€™s (protected_pages) KernelEvents::RESPONSE event subscriber.

Warning: array_key_exists(): The first argument should be either a string or an integer in Drupal\Core\Path\AliasWhitelist->get() (line 120)

๐Ÿ› Bug report
Status

Needs work

Version

9.5

Component
Routingย  โ†’

Last updated 1 day ago

Created by

๐Ÿ‡บ๐Ÿ‡ธUnited States daniel korte Brooklyn, NY

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

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.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    This issue is being reviewed by the kind folks in Slack, #needs-review-queue-initiative. We are working to keep the size of Needs Review queue [2700+ issues] to around 400 (1 month or less), following Review a patch or merge request โ†’ as a guide.

    Did not test the issue but will need a test case to demonstrate the issue please

    Thanks.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States douggreen Winchester, VA

    The problem is more pervasive than this. If you visit /index.php5, something takes everything after "index.php" as the path alias, and you end up here with the path part set to "5" which throws an error.

Production build 0.71.5 2024