mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-12-12 22:19:31 +00:00
Add proper length constraint validations to all string mapped ORM fields, so they show a nice validation error, instead of a 500 error
Fixes issue #544
This commit is contained in:
parent
113e5b3bcd
commit
dc7c13479c
17 changed files with 43 additions and 0 deletions
|
|
@ -27,6 +27,7 @@ use Doctrine\DBAL\Types\Types;
|
|||
use App\Entity\Base\TimestampTrait;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Jbtronics\TFAWebauthn\Model\LegacyU2FKeyInterface;
|
||||
use Symfony\Component\Validator\Constraints\Length;
|
||||
|
||||
#[ORM\Entity]
|
||||
#[ORM\HasLifecycleCallbacks]
|
||||
|
|
@ -44,6 +45,7 @@ class U2FKey implements LegacyU2FKeyInterface, TimeStampableInterface
|
|||
* @var string
|
||||
**/
|
||||
#[ORM\Column(type: Types::STRING, length: 128)]
|
||||
#[Length(max: 128)]
|
||||
public string $keyHandle = '';
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue