Skip to content
Browse files

Merge pull request #6 from Tobion/hostname-routes

fix API of RouteCollection
  • Loading branch information...
2 parents 26e5684 + e120a7a commit 17f51a187317f8af73a25f03a8e8a1e1a4fb4560 @arnaud-lb committed Nov 12, 2012
Showing with 3 additions and 5 deletions.
  1. +3 −5 src/Symfony/Component/Routing/RouteCollection.php
View
8 src/Symfony/Component/Routing/RouteCollection.php
@@ -212,7 +212,9 @@ public function addCollection(RouteCollection $collection, $prefix = '', $defaul
// 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 @@ public function setHostnamePattern($pattern)
{
$this->hostnamePattern = (string) $pattern;
- if ('' === $pattern) {
- return;
- }
-
foreach ($this->routes as $name => $route) {
$route->setHostnamePattern($pattern);
}

0 comments on commit 17f51a1

Please sign in to comment.
Something went wrong with that request. Please try again.