Issue Bug Resolved

#111036Backend routes ignore placeholder requirements

Benjamin Franzke 10/13/26, 06:48 updated 10/13/26, 07:45

Description

Backend routes registered via Configuration/Backend/Routes.php (or
Router::addRoute()) can contain placeholders, e.g. ‘/my-path/{subroute}’.
The Router however creates the Symfony route without any requirements,
so every placeholder falls back to Symfony’s default ‘[^/] ‘.

As a result it is not possible to

  • match or generate a backend URL whose placeholder contains a slash,
    e.g. ‘/typo3/my-path/some/nested/path’,
  • restrict a placeholder to a pattern such as ‘\d ‘.

Generating such a URL via UriBuilder fails with:

Parameter "route" for route "custom-route" must match "[^/]  "
("some/nested/path" given) to generate a corresponding URL.

Expected: A route option ‘requirements’ is passed on to the Symfony
route, so it is honoured by both the UrlMatcher and the UrlGenerator:

'my_route' => [
    'path' => '/my-path/{subroute}',
    'target' => MyController::class . '::handleRequest',
    'requirements' => [
        'subroute' => '.+',
    ],
],

Reviews 2

History 36

  1. Benjamin Franzke commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2026-10-13T07:45:12+00:00" > 10/13/26, 07:45 </span>

    Applied in changeset commit:504647f844444c6908427abe93fc1e12619f28eb.