diff --git a/core/lib/Drupal/Component/Utility/Xss.php b/core/lib/Drupal/Component/Utility/Xss.php
index 4c6e812..490db54 100644
--- a/core/lib/Drupal/Component/Utility/Xss.php
+++ b/core/lib/Drupal/Component/Utility/Xss.php
@@ -54,6 +54,7 @@ class Xss {
* @ingroup sanitization
*/
public static function filter($string, $html_tags = array('a', 'em', 'strong', 'cite', 'blockquote', 'code', 'ul', 'ol', 'li', 'dl', 'dt', 'dd')) {
+ public static function filter($string, $html_tags = array('a', 'em', 'strong', 'cite', 'blockquote', 'code', 'ul', 'ol', 'li', 'dl', 'dt', 'dd')) {
// Only operate on valid UTF-8 strings. This is necessary to prevent cross
// site scripting issues on Internet Explorer 6.
if (!Unicode::validateUtf8($string)) {
diff --git a/core/modules/views_ui/src/ViewListBuilder.php b/core/modules/views_ui/src/ViewListBuilder.php
index cc11d8e..4aa9d24 100644
--- a/core/modules/views_ui/src/ViewListBuilder.php
+++ b/core/modules/views_ui/src/ViewListBuilder.php
@@ -81,11 +81,14 @@ public function load() {
*/
public function buildRow(EntityInterface $view) {
$row = parent::buildRow($view);
- $display_paths = '';
- $separator = '';
+ $prefix = '';
+ $path_data = array();
foreach ($this->getDisplayPaths($view) as $display_path) {
- $display_paths .= $separator . SafeMarkup::escape($display_path);
- $separator = ', ';
+ $path_data[] = array(
+ '#prefix' => $prefix,
+ '#markup' => $display_path,
+ );
+ $prefix = ', ';
}
return array(
'data' => array(
@@ -103,7 +106,9 @@ public function buildRow(EntityInterface $view) {
'class' => array('views-table-filter-text-source'),
),
'tag' => $view->get('tag'),
- 'path' => SafeMarkup::set($display_paths),
+ 'path' => array(
+ 'data' => $path_data,
+ ),
'operations' => $row['operations'],
),
'title' => $this->t('Machine name: @name', array('@name' => $view->id())),
@@ -268,7 +273,7 @@ protected function getDisplayPaths(EntityInterface $view) {
$all_paths[] = \Drupal::l('/' . $path, Url::fromUserInput('/' . $path));
}
else {
- $all_paths[] = SafeMarkup::checkPlain('/' . $path);
+ $all_paths[] = '/' . $path;
}
}
}
diff --git a/core/modules/views_ui/tests/src/Unit/ViewListBuilderTest.php b/core/modules/views_ui/tests/src/Unit/ViewListBuilderTest.php
index a42a879..20aa621 100644
--- a/core/modules/views_ui/tests/src/Unit/ViewListBuilderTest.php
+++ b/core/modules/views_ui/tests/src/Unit/ViewListBuilderTest.php
@@ -89,7 +89,7 @@ public function testBuildRowEntityList() {
);
$page_display->expects($this->any())
->method('getPath')
- ->will($this->returnValue('test_page'));
+ ->will($this->onConsecutiveCalls($this->returnValue('test_page'), $this->returnValue('')));
$embed_display = $this->getMock('Drupal\views\Plugin\views\display\Embed', array('initDisplay'),
array(array(), 'default', $display_manager->getDefinition('embed'))
@@ -106,6 +106,11 @@ public function testBuildRowEntityList() {
$values['display']['page_1']['display_plugin'] = 'page';
$values['display']['page_1']['display_options']['path'] = 'test_page';
+ $values['display']['page_2']['id'] = 'page_2';
+ $values['display']['page_2']['display_title'] = 'Page 2';
+ $values['display']['page_2']['display_plugin'] = 'page';
+ $values['display']['page_2']['display_options']['path'] = '';
+
$values['display']['embed']['id'] = 'embed';
$values['display']['embed']['display_title'] = 'Embedded';
$values['display']['embed']['display_plugin'] = 'embed';
@@ -115,6 +120,7 @@ public function testBuildRowEntityList() {
->will($this->returnValueMap(array(
array('default', $values['display']['default'], $default_display),
array('page', $values['display']['page_1'], $page_display),
+ array('page', $values['display']['page_2'], $page_display),
array('embed', $values['display']['embed'], $embed_display),
)));
@@ -141,8 +147,14 @@ public function testBuildRowEntityList() {
$row = $view_list_builder->buildRow($view);
- $this->assertEquals(array('Embed admin label', 'Page admin label'), $row['data']['view_name']['data']['#displays'], 'Wrong displays got added to view list');
- $this->assertEquals($row['data']['path'], '/test_page', 'The path of the page display is not added.');
+ $expected_displays = array(
+ 'Embed admin label',
+ 'Page admin label',
+ 'Page admin label',
+ );
+ $this->assertEquals($expected_displays, $row['data']['view_name']['data']['#displays'], 'Wrong displays got added to view list');
+ $this->assertEquals($row['data']['path']['data'][0]['#markup'], '/test_page', 'The path of the page display is not added.');
+ $this->assertEquals($row['data']['path']['data'][1]['#markup'], '/<object>malformed_path</object>', 'The malformed path of the page display is not escaped.');
}
}