From e120a7acba03176ae0340e457d594f59b835c0ce Mon Sep 17 00:00:00 2001 From: Tobias Schultze Date: Mon, 12 Nov 2012 13:06:49 +0100 Subject: [PATCH] fix API of RouteCollection --- src/Symfony/Component/Routing/RouteCollection.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/Symfony/Component/Routing/RouteCollection.php b/src/Symfony/Component/Routing/RouteCollection.php index 38c82a85f6..7fc0304211 100644 --- a/src/Symfony/Component/Routing/RouteCollection.php +++ b/src/Symfony/Component/Routing/RouteCollection.php @@ -212,7 +212,9 @@ class RouteCollection implements \IteratorAggregate, \Countable // necessarily already have it applied (depending on the order RouteCollections are added to each other) $collection->addPrefix($this->getPrefix() . $prefix, $defaults, $requirements, $options); - $collection->setHostnamePattern($hostnamePattern); + if ('' !== $hostnamePattern) { + $collection->setHostnamePattern($hostnamePattern); + } $this->routes[] = $collection; } @@ -284,10 +286,6 @@ class RouteCollection implements \IteratorAggregate, \Countable { $this->hostnamePattern = (string) $pattern; - if ('' === $pattern) { - return; - } - foreach ($this->routes as $name => $route) { $route->setHostnamePattern($pattern); }