Version 1
[yaffs-website] / web / core / modules / system / tests / modules / menu_test / src / Plugin / Derivative / LocalTaskTestWithUnsafeTitle.php
1 <?php
2
3 namespace Drupal\menu_test\Plugin\Derivative;
4
5 use Drupal\Component\Plugin\Derivative\DeriverBase;
6
7 /**
8  * Test derivative to check local task title escaping.
9  *
10  * @see \Drupal\system\Tests\Menu\LocalTasksTest
11  */
12 class LocalTaskTestWithUnsafeTitle extends DeriverBase {
13
14   /**
15    * {@inheritdoc}
16    */
17   public function getDerivativeDefinitions($base_plugin_definition) {
18     $this->derivatives['unsafe'] = [
19       'title' => "<script>alert('Welcome to the derived jungle!')</script>",
20       'route_parameters' => ['bar' => 'unsafe'],
21     ] + $base_plugin_definition;
22
23     return $this->derivatives;
24   }
25
26 }