Security update for Core, with self-updated composer
[yaffs-website] / web / core / modules / filter / src / Plugin / Filter / FilterHtmlImageSecure.php
1 <?php
2
3 namespace Drupal\filter\Plugin\Filter;
4
5 use Drupal\filter\FilterProcessResult;
6 use Drupal\filter\Plugin\FilterBase;
7
8 /**
9  * Provides a filter to restrict images to site.
10  *
11  * @Filter(
12  *   id = "filter_html_image_secure",
13  *   title = @Translation("Restrict images to this site"),
14  *   description = @Translation("Disallows usage of &lt;img&gt; 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,
16  *   weight = 9
17  * )
18  */
19 class FilterHtmlImageSecure extends FilterBase {
20
21   /**
22    * {@inheritdoc}
23    */
24   public function process($text, $langcode) {
25     return new FilterProcessResult(_filter_html_image_secure_process($text));
26   }
27
28   /**
29    * {@inheritdoc}
30    */
31   public function tips($long = FALSE) {
32     return $this->t('Only images hosted on this site may be used in &lt;img&gt; tags.');
33   }
34
35 }