Permalink
Browse files

merged branch Tobion/patch-6 (PR #6065)

This PR was merged into the master branch.

Commits
-------

e39b709 [Routing] initialize the Route properties

Discussion
----------

[Routing] initialize the Route properties

They should normally be initialized anyway in the constructor. But when extending the Route (like in CMF) and using an ORM/ODM to persist them in the DB, the constructor is not called. Then a new property that is not saved like hostnamePattern stays null which in turn makes the RouteCompiler fails as it expects '' instead of null.
  • Loading branch information...
2 parents 382d580 + e39b709 commit 4e973e431b76f90b0d157e87a505478e55a0069f @fabpot fabpot committed Nov 19, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/Symfony/Component/Routing/Route.php
View
4 src/Symfony/Component/Routing/Route.php
@@ -23,12 +23,12 @@ class Route implements \Serializable
/**
* @var string
*/
- private $pattern;
+ private $pattern = '/';
/**
* @var string
*/
- private $hostnamePattern;
+ private $hostnamePattern = '';
/**
* @var array

0 comments on commit 4e973e4

Please sign in to comment.