Standard::getAllowedTags

protected static Standard::getAllowedTags($restrictions)

Get all allowed tags from a restrictions data structure.

Parameters

array|false $restrictions: Restrictions as returned by FilterInterface::getHTMLRestrictions().

Return value

array An array of allowed HTML tags.

See also

\Drupal\filter\Plugin\Filter\FilterInterface::getHTMLRestrictions()

File

core/modules/editor/src/EditorXssFilter/Standard.php, line 131

Class

Standard
Defines the standard text editor XSS filter.

Namespace

Drupal\editor\EditorXssFilter

Code

protected static function getAllowedTags($restrictions) {
  if ($restrictions === FALSE || !isset($restrictions['allowed'])) {
    return array();
  }

  $allowed_tags = array_keys($restrictions['allowed']);
  // Exclude the wildcard tag, which is used to set attribute restrictions on
  // all tags simultaneously.
  $allowed_tags = array_diff($allowed_tags, array('*'));

  return $allowed_tags;
}
doc_Drupal
2016-10-29 09:43:54
Comments
Leave a Comment

Please login to continue.