function SourceEditingPreventSelfXssConstraintValidator::getRegExForWildCardAttributeName

Same name in other branches
  1. 10 core/modules/ckeditor5/src/Plugin/Validation/Constraint/SourceEditingPreventSelfXssConstraintValidator.php \Drupal\ckeditor5\Plugin\Validation\Constraint\SourceEditingPreventSelfXssConstraintValidator::getRegExForWildCardAttributeName()
  2. 11.x core/modules/ckeditor5/src/Plugin/Validation/Constraint/SourceEditingPreventSelfXssConstraintValidator.php \Drupal\ckeditor5\Plugin\Validation\Constraint\SourceEditingPreventSelfXssConstraintValidator::getRegExForWildCardAttributeName()

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) . '$/';
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.