Problem/Motivation

Protected Pages Extra throws an InvalidArgumentException when the site is accessed with a double slash (//) in the URL.

For example:
https://example.com//
This causes ProtectedPagesExtraAccessChecker::matchPath() to pass a path that does not start with a slash to Drupal's AliasManager::getAliasByPath(), resulting in:

InvalidArgumentException: Source path has to start with a slash. in Drupal\path_alias\AliasManager->getAliasByPath() (line 111 of core/modules/path_alias/src/AliasManager.php).
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

lamtran3101 created an issue. See original summary.

marco.pagliarulo’s picture

I am not able to replicate the issue.
I tried with D11 single language, D11 double language (path and domain negotiator)
I could simply verify on my end that $path is correct, but I'd like to understand what's going on, so any further info would be nice.

marco.pagliarulo’s picture

Issue replicated, my local proxy normalised the path before it could come to Drupal.

Drupal RouteProvider performs
$path = $path === '/' ? $path : rtrim($request->getPathInfo(), '/');
So in case like '//' or '///' or any number of concatenated slashes, the result is an empty string.

marco.pagliarulo’s picture

Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

marco.pagliarulo’s picture

Status: Fixed » Closed (fixed)