FileExtensionSecureConstraint.php
Same filename and directory in other branches
Namespace
Drupal\file\Plugin\Validation\ConstraintFile
-
core/
modules/ file/ src/ Plugin/ Validation/ Constraint/ FileExtensionSecureConstraint.php
View source
<?php
declare (strict_types=1);
namespace Drupal\file\Plugin\Validation\Constraint;
use Drupal\Core\StringTranslation\TranslatableMarkup;
use Drupal\Core\Validation\Attribute\Constraint;
use Symfony\Component\Validator\Attribute\HasNamedArguments;
use Symfony\Component\Validator\Constraint as SymfonyConstraint;
/**
* File extension secure constraint.
*/
class FileExtensionSecureConstraint extends SymfonyConstraint {
public function __construct(mixed $options = NULL, public string $message = 'For security reasons, your upload has been rejected.', ?array $groups = NULL, mixed $payload = NULL) {
parent::__construct($options, $groups, $payload);
}
}
Classes
| Title | Deprecated | Summary |
|---|---|---|
| FileExtensionSecureConstraint | File extension secure constraint. |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.