Skip to content

Commit

Permalink
Constraints: check extension/mime by lower case
Browse files Browse the repository at this point in the history
  • Loading branch information
stdex committed Dec 5, 2022
1 parent 223613f commit c864319
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Constraint/ExtensionConstraint.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ class ExtensionConstraint implements ConstraintInterface

public function __construct(array $allowedExtensions)
{
$this->allowedExtensions = $allowedExtensions;
$this->allowedExtensions = array_map('strtolower', $allowedExtensions);
}

/**
* {@inheritdoc}
*/
public function validate(UploadedFile $file): bool
{
return in_array($file->getClientOriginalExtension(), $this->allowedExtensions);
return in_array(strtolower($file->getClientOriginalExtension()), $this->allowedExtensions);
}

/**
Expand Down

0 comments on commit c864319

Please sign in to comment.