Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 10a8911

Browse files
committed
restore path separator check in node constructor
1 parent 7c790f9 commit 10a8911

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/Symfony/Component/Config/Definition/BaseNode.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,15 @@ abstract class BaseNode implements NodeInterface
4242
* @param string $name The name of the node
4343
* @param NodeInterface $parent The parent of this node
4444
* @param string $pathSeparator The Path Separator that is used
45+
*
46+
* @throws \InvalidArgumentException if the name contains path separator
4547
*/
4648
public function __construct($name, NodeInterface $parent = null, $pathSeparator = self::DEFAULT_PATH_SEPARATOR)
4749
{
50+
if (false !== strpos($name, $pathSeparator)) {
51+
throw new \InvalidArgumentException('The name must not contain "'.$pathSeparator.'".');
52+
}
53+
4854
$this->name = $name;
4955
$this->parent = $parent;
5056
$this->pathSeparator = $pathSeparator;

0 commit comments

Comments
 (0)