function HandlerBase::sanitizeValue
Same name in other branches
- 9 core/modules/views/src/Plugin/views/HandlerBase.php \Drupal\views\Plugin\views\HandlerBase::sanitizeValue()
- 8.9.x core/modules/views/src/Plugin/views/HandlerBase.php \Drupal\views\Plugin\views\HandlerBase::sanitizeValue()
- 10 core/modules/views/src/Plugin/views/HandlerBase.php \Drupal\views\Plugin\views\HandlerBase::sanitizeValue()
Overrides ViewsHandlerInterface::sanitizeValue
17 calls to HandlerBase::sanitizeValue()
- DblogMessage::render in core/
modules/ dblog/ src/ Plugin/ views/ field/ DblogMessage.php - DblogOperations::render in core/
modules/ dblog/ src/ Plugin/ views/ field/ DblogOperations.php - EntityLabel::render in core/
modules/ views/ src/ Plugin/ views/ field/ EntityLabel.php - FieldPluginBase::render in core/
modules/ views/ src/ Plugin/ views/ field/ FieldPluginBase.php - FieldTest::render in core/
modules/ views/ tests/ modules/ views_test_data/ src/ Plugin/ views/ field/ FieldTest.php
File
-
core/
modules/ views/ src/ Plugin/ views/ HandlerBase.php, line 204
Class
- HandlerBase
- Base class for Views handler plugins.
Namespace
Drupal\views\Plugin\viewsCode
public function sanitizeValue($value, $type = NULL) {
if ($value === NULL) {
return '';
}
switch ($type) {
case 'xss':
$value = Xss::filter($value);
break;
case 'xss_admin':
$value = Xss::filterAdmin($value);
break;
case 'url':
$value = Html::escape(UrlHelper::stripDangerousProtocols($value));
break;
default:
$value = Html::escape($value);
break;
}
return ViewsRenderPipelineMarkup::create($value);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.