Same name and namespace in other branches
- 8.9.x core/lib/Drupal/Component/Utility/Xss.php \Drupal\Component\Utility\Xss::filterAdmin()
- 9 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()
14 calls to Xss::filterAdmin()
- AreaTest::testRenderArea in core/
modules/ views/ tests/ src/ Kernel/ Handler/ AreaTest.php - Tests the rendering of an area.
- Custom::render in core/
modules/ views/ src/ Plugin/ views/ field/ Custom.php - DbLogController::formatMessage in core/
modules/ dblog/ src/ Controller/ DbLogController.php - Formats a database log message.
- HtmlTag::preRenderHtmlTag in core/
lib/ Drupal/ Core/ Render/ Element/ HtmlTag.php - Pre-render callback: Renders a generic HTML tag with attributes.
- node_help in core/
modules/ node/ node.module - Implements hook_help().
File
- core/
lib/ Drupal/ Component/ Utility/ Xss.php, line 122
Class
- Xss
- Provides helper to filter for cross-site scripting.
Namespace
Drupal\Component\UtilityCode
public static function filterAdmin($string) {
return static::filter($string, static::$adminTags);
}