Skip to content

Commit

Permalink
[DependencyInjection] added a check for the class name when dumping a…
Browse files Browse the repository at this point in the history
… container to PHP
  • Loading branch information
fabpot committed Jul 16, 2010
1 parent 10ee13a commit ca87621
Showing 1 changed file with 4 additions and 0 deletions.
Expand Up @@ -87,6 +87,10 @@ protected function addServiceInstance($id, $definition)
{
$class = $this->dumpValue($definition->getClass());

if (0 === strpos($class, "'") && !preg_match('/^\'[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*\'$/', $class)) {
throw new \InvalidArgumentException(sprintf('"%s" is not a valid class name.', $class));
}

$arguments = array();
foreach ($definition->getArguments() as $value) {
$arguments[] = $this->dumpValue($value);
Expand Down

0 comments on commit ca87621

Please sign in to comment.