mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-03-14 19:29:34 +01:00
Use a proper range constraint on the form
Otherwise it is possible to inject invalid data
This commit is contained in:
@@ -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]),
|
||||
],
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -69,4 +72,4 @@ class FieldToProviderMappingType extends AbstractType
|
||||
'field_choices' => [],
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user