class FilterHtmlImageSecure in Drupal 10
Same name and namespace in other branches
- 8 core/modules/filter/src/Plugin/Filter/FilterHtmlImageSecure.php \Drupal\filter\Plugin\Filter\FilterHtmlImageSecure
- 9 core/modules/filter/src/Plugin/Filter/FilterHtmlImageSecure.php \Drupal\filter\Plugin\Filter\FilterHtmlImageSecure
Provides a filter to restrict images to site.
Plugin annotation
@Filter(
id = "filter_html_image_secure",
title = @Translation("Restrict images to this site"),
description = @Translation("Disallows usage of <img> tag sources that are not hosted on this site by replacing them with a placeholder image."),
type = Drupal\filter\Plugin\FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE,
weight = 9
)
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements DerivativeInspectionInterface, PluginInspectionInterface
- class \Drupal\Core\Plugin\PluginBase uses DependencySerializationTrait, MessengerTrait, StringTranslationTrait
- class \Drupal\filter\Plugin\FilterBase implements FilterInterface
- class \Drupal\filter\Plugin\Filter\FilterHtmlImageSecure
- class \Drupal\filter\Plugin\FilterBase implements FilterInterface
- class \Drupal\Core\Plugin\PluginBase uses DependencySerializationTrait, MessengerTrait, StringTranslationTrait
Expanded class hierarchy of FilterHtmlImageSecure
File
- core/
modules/ filter/ src/ Plugin/ Filter/ FilterHtmlImageSecure.php, line 19
Namespace
Drupal\filter\Plugin\FilterView source
class FilterHtmlImageSecure extends FilterBase {
/**
* {@inheritdoc}
*/
public function process($text, $langcode) {
return new FilterProcessResult(_filter_html_image_secure_process($text));
}
/**
* {@inheritdoc}
*/
public function tips($long = FALSE) {
return $this
->t('Only images hosted on this site may be used in <img> tags.');
}
}