-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Closed
Description
Description
On this owasp page we can see Set a filename length limit. Restrict the allowed characters if possible
.
I could be interesting to add an option in the File Constraint to check that ?
If yes, I can create a MR for that.
Example
For example we can have :
// src/Entity/Author.php
namespace App\Entity;
use Symfony\Component\Validator\Constraints as Assert;
class Author
{
#[Assert\File(
maxSize: '1024k',
filenameMaxLength: 50,
filenameMaxLengthMessage: 'The filename is too long. It should have 50 character or less.'
)]
protected $bioFile;
}
Arman-Hosseini and max-petrovich