You are here

public static function Xss::filterAdmin in Drupal 8

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Component/Utility/Xss.php \Drupal\Component\Utility\Xss::filterAdmin()
  2. 10 core/lib/Drupal/Component/Utility/Xss.php \Drupal\Component\Utility\Xss::filterAdmin()

Applies a very permissive XSS/HTML filter for admin-only use.

Use only for fields where it is impractical to use the whole filter system, but where some (mainly inline) mark-up is desired (so \Drupal\Component\Utility\Html::escape() is not acceptable).

Allows all tags that can be used inside an HTML body, save for scripts and styles.

Parameters

string $string: The string to apply the filter to.

Return value

string The filtered string.

See also

\Drupal\Component\Utility\Xss::getAdminTagList()

Related topics

26 calls to Xss::filterAdmin()
AreaTest::testRenderArea in core/modules/views/tests/src/Functional/Handler/AreaTest.php
Tests the rendering of an area.
Boolean::render in core/modules/views/src/Plugin/views/field/Boolean.php
Renders the field.
Custom::render in core/modules/views/src/Plugin/views/field/Custom.php
Renders the field.
DbLogController::formatMessage in core/modules/dblog/src/Controller/DbLogController.php
Formats a database log message.
DisplayTest::execute in core/modules/views/tests/modules/views_test_data/src/Plugin/views/display/DisplayTest.php
Executes the view and returns data in the format required.

... See full list

File

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

Class

Xss
Provides helper to filter for cross-site scripting.

Namespace

Drupal\Component\Utility

Code

public static function filterAdmin($string) {
  return static::filter($string, static::$adminTags);
}