Version 1
[yaffs-website] / web / core / modules / system / tests / modules / menu_test / src / Plugin / Derivative / MenuLinkTestWithUnsafeTitle.php
1 <?php
2
3 namespace Drupal\menu_test\Plugin\Derivative;
4
5 use Drupal\Component\Plugin\Derivative\DeriverBase;
6
7 /**
8  * Test derivative with an unsafe string.
9  */
10 class MenuLinkTestWithUnsafeTitle extends DeriverBase {
11
12   /**
13    * {@inheritdoc}
14    */
15   public function getDerivativeDefinitions($base_plugin_definition) {
16     $this->derivatives['unsafe'] = [
17         'title' => '<script>alert("Even more wild animals")</script>',
18         'menu_name' => 'tools',
19       ] + $base_plugin_definition;
20
21     return $this->derivatives;
22   }
23
24 }