function SourceEditingPreventSelfXssConstraintValidator::isWildcardAttributeName

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

Checks whether the given attribute name contains a wildcard, e.g. `data-*`.

Parameters

string $attribute_name: The attribute name to check.

Return value

bool Whether the given attribute name contains a wildcard.

2 calls to SourceEditingPreventSelfXssConstraintValidator::isWildcardAttributeName()
SourceEditingPreventSelfXssConstraintValidator::getRegExForWildCardAttributeName in core/modules/ckeditor5/src/Plugin/Validation/Constraint/SourceEditingPreventSelfXssConstraintValidator.php
Computes a regular expression for matching a wildcard attribute name.
SourceEditingPreventSelfXssConstraintValidator::validate in core/modules/ckeditor5/src/Plugin/Validation/Constraint/SourceEditingPreventSelfXssConstraintValidator.php

File

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

Class

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

Namespace

Drupal\ckeditor5\Plugin\Validation\Constraint

Code

private static function isWildcardAttributeName(string $attribute_name) : bool {
    assert($attribute_name !== '*');
    return strpos($attribute_name, '*') !== FALSE;
}

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