10000 [Form] action allows only strings · symfony/symfony@cd4a0fe · GitHub
[go: up one dir, main page]

Skip to content

Commit cd4a0fe

Browse files
committed
[Form] action allows only strings
1 parent e1a522b commit cd4a0fe

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/Symfony/Component/Form/Extension/Core/Type/FormType.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ public function configureOptions(OptionsResolver $resolver)
193193
]);
194194

195195
$resolver->setAllowedTypes('label_attr', 'array');
196+
$resolver->setAllowedTypes('action', 'string');
196197
$resolver->setAllowedTypes('upload_max_size_message', ['callable']);
197198
$resolver->setAllowedTypes('help', ['string', 'null']);
198199
$resolver->setAllowedTypes('help_attr', 'array');

src/Symfony/Component/Form/Tests/Extension/Core/Type/FormTypeTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,12 @@ public function testAttributesException()
341341
$this->factory->create(static::TESTED_TYPE, null, ['attr' => '']);
342342
}
343343

344+
public function testActionCannotBeNull()
345+
{
346+
$this->expectException('Symfony\Component\OptionsResolver\Exception\InvalidOptionsException');
347+
$this->factory->create(static::TESTED_TYPE, null, ['action' => null]);
348+
}
349+
344350
public function testNameCanBeEmptyString()
345351
{
346352
$form = $this->factory->createNamed('', static::TESTED_TYPE);

0 commit comments

Comments
 (0)
0