mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-12-06 02:59:29 +00:00
Use a proper range constraint on the form
Otherwise it is possible to inject invalid data
This commit is contained in:
parent
41a7238ab7
commit
a399b629d1
1 changed files with 5 additions and 2 deletions
|
|
@ -59,7 +59,10 @@ class FieldToProviderMappingType extends AbstractType
|
||||||
'max' => 10,
|
'max' => 10,
|
||||||
'class' => 'form-control-sm',
|
'class' => 'form-control-sm',
|
||||||
'style' => 'width: 80px;'
|
'style' => 'width: 80px;'
|
||||||
]
|
],
|
||||||
|
'constraints' => [
|
||||||
|
new \Symfony\Component\Validator\Constraints\Range(['min' => 1, 'max' => 10]),
|
||||||
|
],
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -69,4 +72,4 @@ class FieldToProviderMappingType extends AbstractType
|
||||||
'field_choices' => [],
|
'field_choices' => [],
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue