-
-
Notifications
You must be signed in to change notification settings - Fork 9.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature #24387 [FORM] Prevent forms from extending itself as a parent…
… (pierredup) This PR was squashed before being merged into the 3.4 branch (closes #24387). Discussion ---------- [FORM] Prevent forms from extending itself as a parent | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | N/A | License | MIT | Doc PR | N/A If a form type defines itself as a parent, it results in an endless recursive loop in the form registry, so throw an exception instead. Commits ------- 2ee6fd5 [FORM] Prevent forms from extending itself as a parent
- Loading branch information
Showing
6 changed files
with
145 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
src/Symfony/Component/Form/Tests/Fixtures/FormWithSameParentType.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Symfony package. | ||
* | ||
* (c) Fabien Potencier <fabien@symfony.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Symfony\Component\Form\Tests\Fixtures; | ||
|
||
use Symfony\Component\Form\AbstractType; | ||
|
||
class FormWithSameParentType extends AbstractType | ||
{ | ||
public function getParent() | ||
{ | ||
return self::class; | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
src/Symfony/Component/Form/Tests/Fixtures/RecursiveFormTypeBar.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Symfony package. | ||
* | ||
* (c) Fabien Potencier <fabien@symfony.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Symfony\Component\Form\Tests\Fixtures; | ||
|
||
use Symfony\Component\Form\AbstractType; | ||
|
||
class RecursiveFormTypeBar extends AbstractType | ||
{ | ||
public function getParent() | ||
{ | ||
return RecursiveFormTypeBaz::class; | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
src/Symfony/Component/Form/Tests/Fixtures/RecursiveFormTypeBaz.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Symfony package. | ||
* | ||
* (c) Fabien Potencier <fabien@symfony.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Symfony\Component\Form\Tests\Fixtures; | ||
|
||
use Symfony\Component\Form\AbstractType; | ||
|
||
class RecursiveFormTypeBaz extends AbstractType | ||
{ | ||
public function getParent() | ||
{ | ||
return RecursiveFormTypeFoo::class; | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
src/Symfony/Component/Form/Tests/Fixtures/RecursiveFormTypeFoo.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Symfony package. | ||
* | ||
* (c) Fabien Potencier <fabien@symfony.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Symfony\Component\Form\Tests\Fixtures; | ||
|
||
use Symfony\Component\Form\AbstractType; | ||
|
||
class RecursiveFormTypeFoo extends AbstractType | ||
{ | ||
public function getParent() | ||
{ | ||
return RecursiveFormTypeBar::class; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters