forked from silexphp/Silex
-
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bug silexphp#1360 Registering the silex form extension last to ensure…
… user specified ex… (skalpa) This PR was merged into the 2.0.x-dev branch. Discussion ---------- Registering the silex form extension last to ensure user specified ex… …tensions can modify the behavior of the CSRF and Validator extensions. Fixes silexphp#1358 Commits ------- c21798c Registering the silex form extension last to ensure user specified extensions can modify the behavior of the CSRF and Validator extensions.
- Loading branch information
Showing
3 changed files
with
41 additions
and
1 deletion.
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
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
tests/Silex/Tests/Provider/FormServiceProviderTest/DisableCsrfExtension.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 | ||
|
||
namespace Silex\Tests\Provider\FormServiceProviderTest; | ||
|
||
use Symfony\Component\Form\AbstractTypeExtension; | ||
use Symfony\Component\Form\Extension\Core\Type\FormType; | ||
use Symfony\Component\OptionsResolver\OptionsResolver; | ||
|
||
class DisableCsrfExtension extends AbstractTypeExtension | ||
{ | ||
public function configureOptions(OptionsResolver $resolver) | ||
{ | ||
$resolver->setDefaults(array( | ||
'csrf_protection' => false, | ||
)); | ||
} | ||
|
||
public function getExtendedType() | ||
{ | ||
return FormType::class; | ||
} | ||
} |