3 namespace Drupal\filter\Plugin\Filter;
5 use Drupal\filter\FilterProcessResult;
6 use Drupal\filter\Plugin\FilterBase;
9 * Provides a filter to restrict images to site.
12 * id = "filter_html_image_secure",
13 * title = @Translation("Restrict images to this site"),
14 * description = @Translation("Disallows usage of <img> tag sources that are not hosted on this site by replacing them with a placeholder image."),
15 * type = Drupal\filter\Plugin\FilterInterface::TYPE_TRANSFORM_IRREVERSIBLE,
19 class FilterHtmlImageSecure extends FilterBase {
24 public function process($text, $langcode) {
25 return new FilterProcessResult(_filter_html_image_secure_process($text));
31 public function tips($long = FALSE) {
32 return $this->t('Only images hosted on this site may be used in <img> tags.');