Skip to content

Upgrading symfony/routing 4 to 5

Unknownv4.4.44 → v5.4.57Security7Fixed10

Fetching 84 releases from GitHub…16 / 84
UnknownUpgrade verdict

DepDelta is still reading the notes for 68 of 84 releases, so breaking changes can't be ruled out yet.

  • DepDelta is still reading the release notes in this range, so it can't rule out breaking changes yet.
  • This page updates as the notes come in.
Top 3 of 7 that need code or config changes

PHP requirement changed in v5.1.0-RC2: >=7.1.3 → >=7.2.5.

Adds symfony/deprecation-contracts ^2.1|^3.

Security7
Rejects host parameters that contain forbidden characters.
Prevents generated URLs from pointing to another host.
Prevents router redirects from sending paths starting with // to another host.
Prevents host placeholders from matching the path in compiled matchers.
Marks this as a security release.
Fixes dot-segment encoding for chained "../" and "./" sequences in generated URLs (CVE-2026-48784).
Moderate
Fixes regex alternation anchoring in UrlGenerator requirement validation (CVE-2026-45065).
UrlGeneratorModerate

Generated by DepDelta from published PHP source. Not mixed with prose notes.

  • changed: constructor CompiledRoute(string $staticPrefix, string $regex, array $tokens, array $pathVariables, string $hostRegex = …, array $hostTokens = …, array $hostVariables = …, array $variables = …) → constructor CompiledRoute(string $staticPrefix, string $regex, array $tokens, array $pathVariables, ?string $hostRegex = …, array $hostTokens = …, array $hostVariables = …, array $variables = …)
  • changed: constructor RouteCollectionBuilder(LoaderInterface $loader = …) → constructor RouteCollectionBuilder(?LoaderInterface $loader = …)
  • changed: constructor Router(LoaderInterface $loader, $resource, array $options = …, RequestContext $context = …, LoggerInterface $logger = …, string $defaultLocale = …) → constructor Router(LoaderInterface $loader, $resource, array $options = …, ?RequestContext $context = …, ?LoggerInterface $logger = …, ?string $defaultLocale = …)
  • changed: method CompiledRoute.serialize() → method CompiledRoute.serialize(): string
  • changed: method RequestContext.getParameter($name) → method RequestContext.getParameter(string $name)
  • changed: method RequestContext.hasParameter($name) → method RequestContext.hasParameter(string $name)
  • changed: method RequestContext.setBaseUrl($baseUrl) → method RequestContext.setBaseUrl(string $baseUrl)
  • changed: method RequestContext.setHost($host) → method RequestContext.setHost(string $host)
  • changed: method RequestContext.setHttpPort($httpPort) → method RequestContext.setHttpPort(int $httpPort)
  • changed: method RequestContext.setHttpsPort($httpsPort) → method RequestContext.setHttpsPort(int $httpsPort)
  • changed: method RequestContext.setMethod($method) → method RequestContext.setMethod(string $method)
  • changed: method RequestContext.setParameter($name, $parameter) → method RequestContext.setParameter(string $name, $parameter)
  • changed: method RequestContext.setPathInfo($pathInfo) → method RequestContext.setPathInfo(string $pathInfo)
  • changed: method RequestContext.setQueryString($queryString) → method RequestContext.setQueryString(?string $queryString)
  • changed: method RequestContext.setScheme($scheme) → method RequestContext.setScheme(string $scheme)
  • changed: method Route.getDefault($name) → method Route.getDefault(string $name)
  • changed: method Route.getOption($name) → method Route.getOption(string $name)
  • changed: method Route.getRequirement($key) → method Route.getRequirement(string $key)
  • changed: method Route.hasDefault($name) → method Route.hasDefault(string $name)
  • changed: method Route.hasOption($name) → method Route.hasOption(string $name)
  • changed: method Route.hasRequirement($key) → method Route.hasRequirement(string $key)
  • changed: method Route.hasScheme($scheme) → method Route.hasScheme(string $scheme)
  • changed: method Route.serialize() → method Route.serialize(): string
  • changed: method Route.setCondition($condition) → method Route.setCondition(?string $condition)
  • changed: method Route.setDefault($name, $default) → method Route.setDefault(string $name, $default)
  • changed: method Route.setHost($pattern) → method Route.setHost(?string $pattern)
  • changed: method Route.setOption($name, $value) → method Route.setOption(string $name, $value)
  • changed: method Route.setPath($pattern) → method Route.setPath(string $pattern)
  • changed: method Route.setRequirement($key, $regex) → method Route.setRequirement(string $key, string $regex)
  • changed: method RouteCollection.add($name, Route $route) → method RouteCollection.add(string $name, Route $route)
  • changed: method RouteCollection.addPrefix($prefix, array $defaults = …, array $requirements = …) → method RouteCollection.addPrefix(string $prefix, array $defaults = …, array $requirements = …)
  • changed: method RouteCollection.get($name) → method RouteCollection.get(string $name)
  • changed: method RouteCollection.setCondition($condition) → method RouteCollection.setCondition(?string $condition)
  • changed: method RouteCollection.setHost($pattern, array $defaults = …, array $requirements = …) → method RouteCollection.setHost(?string $pattern, array $defaults = …, array $requirements = …)
  • changed: method RouteCollectionBuilder.add($path, $controller, $name = …) → method RouteCollectionBuilder.add(string $path, string $controller, ?string $name = …)
  • changed: method RouteCollectionBuilder.addRoute(Route $route, $name = …) → method RouteCollectionBuilder.addRoute(Route $route, ?string $name = …)
  • changed: method RouteCollectionBuilder.import($resource, $prefix = …, $type = …) → method RouteCollectionBuilder.import($resource, string $prefix = …, ?string $type = …)
  • changed: method RouteCollectionBuilder.mount($prefix, self $builder) → method RouteCollectionBuilder.mount(string $prefix, self $builder)
  • changed: method RouteCollectionBuilder.setCondition($condition) → method RouteCollectionBuilder.setCondition(?string $condition)
  • changed: method RouteCollectionBuilder.setDefault($key, $value) → method RouteCollectionBuilder.setDefault(string $key, $value)
  • changed: method RouteCollectionBuilder.setHost($pattern) → method RouteCollectionBuilder.setHost(?string $pattern)
  • changed: method RouteCollectionBuilder.setOption($key, $value) → method RouteCollectionBuilder.setOption(string $key, $value)
  • changed: method RouteCollectionBuilder.setRequirement($key, $regex) → method RouteCollectionBuilder.setRequirement(string $key, $regex)
  • changed: method Router.generate($name, $parameters = …, $referenceType = …) → method Router.generate(string $name, array $parameters = …, int $referenceType = …)
  • changed: method Router.getOption($key) → method Router.getOption(string $key)
  • changed: method Router.match($pathinfo) → method Router.match(string $pathinfo)
  • changed: method Router.setOption($key, $value) → method Router.setOption(string $key, $value)
  • added: class Alias
  • added: constructor Alias(string $id)
  • added: method Alias.getDeprecation(string $name): array
  • added: method Alias.getId(): string
  • added: method Alias.isDeprecated(): bool
  • added: method Alias.setDeprecated(string $package, string $version, string $message): self
  • added: method Alias.withId(string $id): self
  • added: method RequestContext.isSecure(): bool
  • added: method RouteCollection.addAlias(string $name, string $alias): Alias
  • added: method RouteCollection.getAlias(string $name): ?Alias
  • added: method RouteCollection.getAliases(): array
  • added: method RouteCollection.getPriority(string $name): ?int
  • added: static method RequestContext.fromUri(string $uri, string $host = …, string $scheme = …, int $httpPort = …, int $httpsPort = …): self
  • changed: constructor Route(array $data) → constructor Route($data = …, $path = …, ?string $name = …, array $requirements = …, array $options = …, array $defaults = …, ?string $host = …, $methods = …, $schemes = …, ?string $condition = …, ?int $priority = …, ?string $locale = …, ?string $format = …, ?bool $utf8 = …, ?bool $stateless = …, ?string $env = …)
  • changed: method Route.setCondition($condition) → method Route.setCondition(?string $condition)
  • changed: method Route.setDefaults($defaults) → method Route.setDefaults(array $defaults)
  • changed: method Route.setHost($pattern) → method Route.setHost(string $pattern)
  • changed: method Route.setName($name) → method Route.setName(string $name)
  • changed: method Route.setOptions($options) → method Route.setOptions(array $options)
  • changed: method Route.setPath($path) → method Route.setPath(string $path)
  • changed: method Route.setRequirements($requirements) → method Route.setRequirements(array $requirements)
  • added: method Route.getEnv(): ?string
  • added: method Route.getPriority(): ?int
  • added: method Route.setEnv(?string $env): void
  • added: method Route.setPriority(int $priority): void
  • changed: constructor MethodNotAllowedException(array $allowedMethods, ?string $message = …, int $code = …, \Throwable $previous = …) → constructor MethodNotAllowedException(array $allowedMethods, ?string $message = …, int $code = …, ?\Throwable $previous = …)
  • added: class InvalidArgumentException extends \InvalidArgumentException implements ExceptionInterface
  • added: class RouteCircularReferenceException extends RuntimeException
  • added: class RuntimeException extends \RuntimeException implements ExceptionInterface
  • added: constructor RouteCircularReferenceException(string $routeId, array $path)
  • changed: constructor CompiledUrlGenerator(array $compiledRoutes, RequestContext $context, LoggerInterface $logger = …, string $defaultLocale = …) → constructor CompiledUrlGenerator(array $compiledRoutes, RequestContext $context, ?LoggerInterface $logger = …, ?string $defaultLocale = …)
  • changed: constructor UrlGenerator(RouteCollection $routes, RequestContext $context, LoggerInterface $logger = …, string $defaultLocale = …) → constructor UrlGenerator(RouteCollection $routes, RequestContext $context, ?LoggerInterface $logger = …, ?string $defaultLocale = …)
  • changed: method CompiledUrlGenerator.generate($name, $parameters = …, $referenceType = …) → method CompiledUrlGenerator.generate(string $name, array $parameters = …, int $referenceType = …)
  • changed: method ConfigurableRequirementsInterface.setStrictRequirements($enabled) → method ConfigurableRequirementsInterface.setStrictRequirements(?bool $enabled)
  • changed: method UrlGenerator.generate($name, $parameters = …, $referenceType = …) → method UrlGenerator.generate(string $name, array $parameters = …, int $referenceType = …)
  • changed: method UrlGenerator.setStrictRequirements($enabled) → method UrlGenerator.setStrictRequirements(?bool $enabled)
  • changed: method UrlGeneratorInterface.generate($name, $parameters = …, $referenceType = …) → method UrlGeneratorInterface.generate(string $name, array $parameters = …, int $referenceType = …)
  • changed: protected method UrlGenerator.doGenerate($variables, $defaults, $requirements, $tokens, $parameters, $name, $referenceType, $hostTokens, array $requiredSchemes = …) → protected method UrlGenerator.doGenerate(array $variables, array $defaults, array $requirements, array $tokens, array $parameters, string $name, int $referenceType, array $hostTokens, array $requiredSchemes = …)
  • changed: static method UrlGenerator.getRelativePath($basePath, $targetPath) → static method UrlGenerator.getRelativePath(string $basePath, string $targetPath)
  • removed: class PhpGeneratorDumper extends GeneratorDumper
  • removed: method PhpGeneratorDumper.dump(array $options = …)
  • added: method CompiledUrlGeneratorDumper.getCompiledAliases(): array
  • removed: abstract class ObjectRouteLoader extends ObjectLoader
  • removed: method ObjectRouteLoader.supports($resource, $type = …)
  • removed: protected method ObjectRouteLoader.getObject(string $id)
  • removed: protected method ObjectRouteLoader.getServiceObject($id)
  • changed: constructor AnnotationClassLoader(Reader $reader) → constructor AnnotationClassLoader(?Reader $reader = …, ?string $env = …)
  • changed: constructor ContainerLoader(ContainerInterface $container) → constructor ContainerLoader(ContainerInterface $container, ?string $env = …)
  • changed: method AnnotationClassLoader.load($class, $type = …) → method AnnotationClassLoader.load($class, ?string $type = …)
  • changed: method AnnotationClassLoader.setRouteAnnotationClass($class) → method AnnotationClassLoader.setRouteAnnotationClass(string $class)
  • changed: method AnnotationClassLoader.supports($resource, $type = …) → method AnnotationClassLoader.supports($resource, ?string $type = …)
  • changed: method AnnotationDirectoryLoader.load($path, $type = …) → method AnnotationDirectoryLoader.load($path, ?string $type = …)
  • changed: method AnnotationDirectoryLoader.supports($resource, $type = …) → method AnnotationDirectoryLoader.supports($resource, ?string $type = …)
  • changed: method AnnotationFileLoader.load($file, $type = …) → method AnnotationFileLoader.load($file, ?string $type = …)
  • changed: method AnnotationFileLoader.supports($resource, $type = …) → method AnnotationFileLoader.supports($resource, ?string $type = …)
  • changed: method ClosureLoader.load($closure, $type = …) → method ClosureLoader.load($closure, ?string $type = …)
  • changed: method ClosureLoader.supports($resource, $type = …) → method ClosureLoader.supports($resource, ?string $type = …)
  • changed: method ContainerLoader.supports($resource, $type = …) → method ContainerLoader.supports($resource, ?string $type = …)
  • changed: method DirectoryLoader.load($file, $type = …) → method DirectoryLoader.load($file, ?string $type = …)
  • changed: method DirectoryLoader.supports($resource, $type = …) → method DirectoryLoader.supports($resource, ?string $type = …)
  • changed: method GlobFileLoader.load($resource, $type = …) → method GlobFileLoader.load($resource, ?string $type = …)
  • changed: method GlobFileLoader.supports($resource, $type = …) → method GlobFileLoader.supports($resource, ?string $type = …)
  • changed: method ObjectLoader.load($resource, $type = …) → method ObjectLoader.load($resource, ?string $type = …)
  • changed: method PhpFileLoader.load($file, $type = …) → method PhpFileLoader.load($file, ?string $type = …)
  • changed: method PhpFileLoader.supports($resource, $type = …) → method PhpFileLoader.supports($resource, ?string $type = …)
  • changed: method XmlFileLoader.load($file, $type = …) → method XmlFileLoader.load($file, ?string $type = …)
  • changed: method XmlFileLoader.supports($resource, $type = …) → method XmlFileLoader.supports($resource, ?string $type = …)
  • changed: method YamlFileLoader.load($file, $type = …) → method YamlFileLoader.load($file, ?string $type = …)
  • changed: method YamlFileLoader.supports($resource, $type = …) → method YamlFileLoader.supports($resource, ?string $type = …)
  • changed: protected method AnnotationClassLoader.addRoute(RouteCollection $collection, $annot, $globals, \ReflectionClass $class, \ReflectionMethod $method) → protected method AnnotationClassLoader.addRoute(RouteCollection $collection, object $annot, array $globals, \ReflectionClass $class, \ReflectionMethod $method)
  • changed: protected method AnnotationClassLoader.configureRoute(Route $route, \ReflectionClass $class, \ReflectionMethod $method, $annot) → protected method AnnotationClassLoader.configureRoute(Route $route, \ReflectionClass $class, \ReflectionMethod $method, object $annot)
  • changed: protected method AnnotationClassLoader.createRoute($path, $defaults, $requirements, $options, $host, $schemes, $methods, $condition) → protected method AnnotationClassLoader.createRoute(string $path, array $defaults, array $requirements, array $options, ?string $host, array $schemes, array $methods, ?string $condition)
  • changed: protected method AnnotationFileLoader.findClass($file) → protected method AnnotationFileLoader.findClass(string $file)
  • changed: protected method XmlFileLoader.loadFile($file) → protected method XmlFileLoader.loadFile(string $file)
  • changed: protected method XmlFileLoader.parseImport(RouteCollection $collection, \DOMElement $node, $path, $file) → protected method XmlFileLoader.parseImport(RouteCollection $collection, \DOMElement $node, string $path, string $file)
  • changed: protected method XmlFileLoader.parseNode(RouteCollection $collection, \DOMElement $node, $path, $file) → protected method XmlFileLoader.parseNode(RouteCollection $collection, \DOMElement $node, string $path, string $file)
  • changed: protected method XmlFileLoader.parseRoute(RouteCollection $collection, \DOMElement $node, $path) → protected method XmlFileLoader.parseRoute(RouteCollection $collection, \DOMElement $node, string $path)
  • changed: protected method YamlFileLoader.parseImport(RouteCollection $collection, array $config, $path, $file) → protected method YamlFileLoader.parseImport(RouteCollection $collection, array $config, string $path, string $file)
  • changed: protected method YamlFileLoader.parseRoute(RouteCollection $collection, $name, array $config, $path) → protected method YamlFileLoader.parseRoute(RouteCollection $collection, string $name, array $config, string $path)
  • changed: protected method YamlFileLoader.validate($config, $name, $path) → protected method YamlFileLoader.validate($config, string $name, string $path)
  • added: protected method PhpFileLoader.callConfigurator(callable $result, string $path, string $file): RouteCollection
  • added: protected property AnnotationClassLoader.env
  • changed: constructor CollectionConfigurator(RouteCollection $parent, string $name, self $parentConfigurator = …, array $parentPrefixes = …) → constructor CollectionConfigurator(RouteCollection $parent, string $name, ?self $parentConfigurator = …, ?array $parentPrefixes = …)
  • changed: constructor RouteConfigurator(RouteCollection $collection, $route, string $name = …, CollectionConfigurator $parentConfigurator = …, array $prefixes = …) → constructor RouteConfigurator(RouteCollection $collection, RouteCollection $route, string $name = …, ?CollectionConfigurator $parentConfigurator = …, ?array $prefixes = …)
  • changed: constructor RoutingConfigurator(RouteCollection $collection, PhpFileLoader $loader, string $path, string $file) → constructor RoutingConfigurator(RouteCollection $collection, PhpFileLoader $loader, string $path, string $file, ?string $env = …)
  • changed: method RoutingConfigurator.import($resource, string $type = …, bool $ignoreErrors = …, $exclude = …): ImportConfigurator → method RoutingConfigurator.import($resource, ?string $type = …, bool $ignoreErrors = …, $exclude = …): ImportConfigurator
  • added: class AliasConfigurator
  • added: constructor AliasConfigurator(Alias $alias)
  • added: method AliasConfigurator.deprecate(string $package, string $version, string $message): self
  • added: method CollectionConfigurator.host($host): self
  • added: method ImportConfigurator.host($host): self
  • added: method RouteConfigurator.host($host): self
  • added: method RoutingConfigurator.env(): ?string
  • added: method RoutingConfigurator.withPath(string $path): self
  • added: protected property RouteConfigurator.parentConfigurator
  • added: method AddTrait.alias(string $name, string $alias): AliasConfigurator
  • added: method RouteTrait.stateless(bool $stateless = …): self
  • added: protected method HostTrait.addHost(RouteCollection $routes, $hosts)
  • added: protected method LocalizedRouteTrait.createLocalizedRoute(RouteCollection $collection, string $name, $path, string $namePrefix = …, ?array $prefixes = …): RouteCollection
  • added: protected method PrefixTrait.addPrefix(RouteCollection $routes, $prefix, bool $trailingSlashOnRoot)
  • added: protected property AddTrait.collection
  • added: protected property AddTrait.name
  • added: protected property AddTrait.prefixes
  • added: protected property RouteTrait.route
  • added: trait HostTrait
  • added: trait LocalizedRouteTrait
  • added: trait PrefixTrait
  • removed: class ServiceRouterLoader extends ObjectRouteLoader
  • removed: constructor ServiceRouterLoader(ContainerInterface $container)
  • removed: protected method ServiceRouterLoader.getServiceObject($id)
  • changed: method RedirectableUrlMatcher.match($pathinfo) → method RedirectableUrlMatcher.match(string $pathinfo)
  • changed: method RedirectableUrlMatcherInterface.redirect($path, $route, $scheme = …) → method RedirectableUrlMatcherInterface.redirect(string $path, string $route, ?string $scheme = …)
  • changed: method TraceableUrlMatcher.getTraces($pathinfo) → method TraceableUrlMatcher.getTraces(string $pathinfo)
  • changed: method UrlMatcher.match($pathinfo) → method UrlMatcher.match(string $pathinfo)
  • changed: method UrlMatcherInterface.match($pathinfo) → method UrlMatcherInterface.match(string $pathinfo)
  • changed: protected method TraceableUrlMatcher.matchCollection($pathinfo, RouteCollection $routes) → protected method TraceableUrlMatcher.matchCollection(string $pathinfo, RouteCollection $routes)
  • changed: protected method UrlMatcher.getAttributes(Route $route, $name, array $attributes) → protected method UrlMatcher.getAttributes(Route $route, string $name, array $attributes)
  • changed: protected method UrlMatcher.handleRouteRequirements($pathinfo, $name, Route $route) → protected method UrlMatcher.handleRouteRequirements(string $pathinfo, string $name, Route $route)
  • changed: protected method UrlMatcher.matchCollection($pathinfo, RouteCollection $routes) → protected method UrlMatcher.matchCollection(string $pathinfo, RouteCollection $routes)
  • changed: protected method UrlMatcher.mergeDefaults($params, $defaults) → protected method UrlMatcher.mergeDefaults(array $params, array $defaults)
  • added: class ExpressionLanguageProvider implements ExpressionFunctionProviderInterface
  • added: constructor ExpressionLanguageProvider(ServiceProviderInterface $functions)
  • added: method ExpressionLanguageProvider.get(string $function): callable
  • added: method ExpressionLanguageProvider.getFunctions()
  • removed: class PhpMatcherDumper extends CompiledUrlMatcherDumper
  • removed: method PhpMatcherDumper.dump(array $options = …)
  • changed: method CompiledUrlMatcherTrait.match($pathinfo): array → method CompiledUrlMatcherTrait.match(string $pathinfo): array