You are here

public static function Xss::filterAdmin in Service Container 7

Same name and namespace in other branches
  1. 7.2 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()

File

lib/Drupal/Component/Utility/Xss.php, line 126
Contains \Drupal\Component\Utility\Xss.

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);
}