Use a proper range constraint on the form

Otherwise it is possible to inject invalid data
This commit is contained in:
Jan Böhmer 2025-09-14 23:04:44 +02:00
parent 41a7238ab7
commit a399b629d1

View file

@ -59,7 +59,10 @@ class FieldToProviderMappingType extends AbstractType
'max' => 10,
'class' => 'form-control-sm',
'style' => 'width: 80px;'
]
],
'constraints' => [
new \Symfony\Component\Validator\Constraints\Range(['min' => 1, 'max' => 10]),
],
]);
}