The "Request Path" block visibility condition does not check for valid aliasses

Created on 24 June 2021, about 4 years ago
Updated 3 June 2025, about 1 month ago

Problem/Motivation

The InvalidArgumentException from "$this->aliasManager->getAliasByPath($path)" is left unhandled. So visiting invalid urls causes this subsystem to generate fatal errors.

Steps to reproduce

Have any block setup with any visibility rule applying to the "Request Path" condition.
Visit https://yoursite.com/index.phpsometext

Proposed resolution

Catch the Exception

Remaining tasks

Review and apply patch.

User interface changes

None

API changes

None

Data model changes

None.

Release notes snippet

🐛 Bug report
Status

Active

Version

11.0 🔥

Component

routing system

Created by

🇧🇪Belgium weseze

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.

  • 🇦🇺Australia mstrelan

    Confirming I can reproduce the error with the steps to reproduce. What I don't understand is why anyone would go to a path like /index.phpsometext and why Drupal handles it differently to /sometext. I don't think the RequestPath condition is the right place to handle this, seems like more of a routing issue.

  • 🇧🇪Belgium weseze

    What I don't understand is why anyone would go to a path like /index.phpsometext

    To fill up the logs of a website with errors.
    Or if you want to stay on top of errors and have those on a daily mail or sent through slack or some other platform, this becomes very annoying... Can't think of any legit reason to do so though.

Production build 0.71.5 2024