소스 검색

[DependencyInjection] added a check for the class name when dumping a container to PHP

Fabien Potencier 15 년 전
부모
커밋
44757b0c77
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      src/Symfony/Components/DependencyInjection/Dumper/PhpDumper.php

+ 1 - 1
src/Symfony/Components/DependencyInjection/Dumper/PhpDumper.php

@@ -87,7 +87,7 @@ EOF;
     {
         $class = $this->dumpValue($definition->getClass());
 
-        if (0 === strpos($class, "'") && !preg_match('/^\'[\\a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*\'$/', $class)) {
+        if (0 === strpos($class, "'") && !preg_match('/^\'[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*(\\\{2}[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)*\'$/', $class)) {
             throw new \InvalidArgumentException(sprintf('"%s" is not a valid class name.', $class));
         }