You are here

private static function SourceEditingPreventSelfXssConstraintValidator::getRegExForWildCardAttributeName in Drupal 10

Computes a regular expression for matching a wildcard attribute name.

Parameters

string $wildcard_attribute_name: The wildcard attribute name for which to compute a regular expression.

Return value

string The computed regular expression.

1 call to SourceEditingPreventSelfXssConstraintValidator::getRegExForWildCardAttributeName()
SourceEditingPreventSelfXssConstraintValidator::validate in core/modules/ckeditor5/src/Plugin/Validation/Constraint/SourceEditingPreventSelfXssConstraintValidator.php

File

core/modules/ckeditor5/src/Plugin/Validation/Constraint/SourceEditingPreventSelfXssConstraintValidator.php, line 116

Class

SourceEditingPreventSelfXssConstraintValidator
Ensures Source Editing cannot be configured to allow self-XSS.

Namespace

Drupal\ckeditor5\Plugin\Validation\Constraint

Code

private static function getRegExForWildCardAttributeName(string $wildcard_attribute_name) : string {
  assert(self::isWildcardAttributeName($wildcard_attribute_name));
  return '/^' . str_replace('*', '.*', $wildcard_attribute_name) . '$/';
}