Unverified Commit 687dcd44 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #2656570 by idebr, longwave, mrinalini9, Kristen Pol, joachim:...

Issue #2656570 by idebr, longwave, mrinalini9, Kristen Pol, joachim: DraggableListBuilder does not escape the entity label
parent ff18b59a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -125,7 +125,7 @@ public function buildForm(array $form, FormStateInterface $form_state) {
    foreach ($this->entities as $entity) {
      $row = $this->buildRow($entity);
      if (isset($row['label'])) {
        $row['label'] = ['#markup' => $row['label']];
        $row['label'] = ['#plain_text' => $row['label']];
      }
      if (isset($row['weight'])) {
        $row['weight']['#delta'] = $delta;
+8 −0
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@

namespace Drupal\Tests\config\Functional;

use Drupal\Component\Utility\Html;
use Drupal\Tests\BrowserTestBase;
use Drupal\user\Entity\Role;

@@ -49,6 +50,13 @@ public function testDraggableList() {
    for ($i = 0; $i < 51; $i++) {
      $this->assertSession()->pageTextContains("Role $i");
    }

    $role = Role::load('role_0');
    $role_name = 'Role <b>0</b>';
    $role->set('label', $role_name)->save();

    $this->drupalGet('admin/people/roles');
    $this->assertSession()->responseContains('<td>' . Html::escape($role_name));
  }

}