function Xss::needsRemoval

Same name in other branches
  1. 9 core/lib/Drupal/Component/Utility/Xss.php \Drupal\Component\Utility\Xss::needsRemoval()
  2. 8.9.x core/lib/Drupal/Component/Utility/Xss.php \Drupal\Component\Utility\Xss::needsRemoval()
  3. 11.x core/lib/Drupal/Component/Utility/Xss.php \Drupal\Component\Utility\Xss::needsRemoval()

Whether this element needs to be removed altogether.

Parameters

string[] $html_tags: The list of HTML tags.

string $elem: The name of the HTML element.

Return value

bool TRUE if this element needs to be removed.

1 call to Xss::needsRemoval()
Standard::needsRemoval in core/modules/editor/src/EditorXssFilter/Standard.php
Whether this element needs to be removed altogether.
1 method overrides Xss::needsRemoval()
Standard::needsRemoval in core/modules/editor/src/EditorXssFilter/Standard.php
Whether this element needs to be removed altogether.

File

core/lib/Drupal/Component/Utility/Xss.php, line 340

Class

Xss
Provides helper to filter for cross-site scripting.

Namespace

Drupal\Component\Utility

Code

protected static function needsRemoval(array $html_tags, $elem) {
    return !isset($html_tags[strtolower($elem)]);
}

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