Closed
Description
Symfony version(s) affected: 4.2.2-dev
Description
We have certain routes that have a suffix that is passed as-is to the controller. If the suffix is just a singe slash, that slash is not matched anymore.
Since we strip the slash anyway, this only broke our integration tests. However, such a change is a bit unexpected between minor versions.
How to reproduce
use Symfony\Component\Routing\Matcher\UrlMatcher;
use Symfony\Component\Routing\RequestContext;
use Symfony\Component\Routing\Route;
use Symfony\Component\Routing\RouteCollection;
$routeCollection = new RouteCollection();
$routeCollection->add('test', new Route(
'/some/route{pathSuffix}',
['pathSuffix' => ''],
['pathSuffix' => '(|/.*)']
));
$matcher = new UrlMatcher($routeCollection, new RequestContext());
dump($matcher->match('/some/route/'));
Output with Routing 4.2.1 and below:
array:2 [
"pathSuffix" => "/"
"_route" => "test"
]
Output with Routing 4.2.2-dev:
array:2 [
"pathSuffix" => ""
"_route" => "test"
]