You are here

protected static function BigPipeStrategy::placeholderIsAttributeSafe in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/big_pipe/src/Render/Placeholder/BigPipeStrategy.php \Drupal\big_pipe\Render\Placeholder\BigPipeStrategy::placeholderIsAttributeSafe()
  2. 9 core/modules/big_pipe/src/Render/Placeholder/BigPipeStrategy.php \Drupal\big_pipe\Render\Placeholder\BigPipeStrategy::placeholderIsAttributeSafe()

Determines whether the given placeholder is attribute-safe or not.

Parameters

string $placeholder: A placeholder.

Return value

bool Whether the placeholder is safe for use in an HTML attribute (in case it's a placeholder for an HTML attribute value or a subset of it).

File

core/modules/big_pipe/src/Render/Placeholder/BigPipeStrategy.php, line 182

Class

BigPipeStrategy
Defines the BigPipe placeholder strategy, to send HTML in chunks.

Namespace

Drupal\big_pipe\Render\Placeholder

Code

protected static function placeholderIsAttributeSafe($placeholder) {
  assert(is_string($placeholder));
  return $placeholder[0] !== '<' || $placeholder !== Html::normalize($placeholder);
}