Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. NoSuspiciousCharacters.php

function NoSuspiciousCharacters::__construct

Parameters

array<string,mixed>|null $options:

int-mask-of<self::CHECK_*>|null $checks A bitmask of the checks to perform on the string (defaults to all checks):

int-mask-of<self::RESTRICTION_LEVEL_*>|null $restrictionLevel Configures the set of acceptable characters for the validated string through a specified "level" (defaults to: {@see NoSuspiciousCharacters::RESTRICTION_LEVEL_MODERATE} on ICU >= 58, {@see NoSuspiciousCharacters::RESTRICTION_LEVEL_SINGLE_SCRIPT} otherwise)

string[]|null $locales Restrict the string's characters to those normally used with these locales. Pass null to use the default locales configured for the NoSuspiciousCharactersValidator. (defaults to null):

string[]|null $groups:

Overrides Constraint::__construct

File

vendor/symfony/validator/Constraints/NoSuspiciousCharacters.php, line 92

Class

NoSuspiciousCharacters
Validates that the given string does not contain characters used in spoofing security attacks.

Namespace

Symfony\Component\Validator\Constraints

Code

public function __construct(?array $options = null, ?string $restrictionLevelMessage = null, ?string $invisibleMessage = null, ?string $mixedNumbersMessage = null, ?string $hiddenOverlayMessage = null, ?int $checks = null, ?int $restrictionLevel = null, ?array $locales = null, ?array $groups = null, mixed $payload = null) {
    if (!class_exists(\Spoofchecker::class)) {
        throw new LogicException('The intl extension is required to use the NoSuspiciousCharacters constraint.');
    }
    parent::__construct($options, $groups, $payload);
    $this->restrictionLevelMessage = $restrictionLevelMessage ?? $this->restrictionLevelMessage;
    $this->invisibleMessage = $invisibleMessage ?? $this->invisibleMessage;
    $this->mixedNumbersMessage = $mixedNumbersMessage ?? $this->mixedNumbersMessage;
    $this->hiddenOverlayMessage = $hiddenOverlayMessage ?? $this->hiddenOverlayMessage;
    $this->checks = $checks ?? $this->checks;
    $this->restrictionLevel = $restrictionLevel ?? $this->restrictionLevel;
    $this->locales = $locales ?? $this->locales;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal