diff --git a/core/modules/views_ui/src/Tests/DisplayPathTest.php b/core/modules/views_ui/src/Tests/DisplayPathTest.php
index aaaa069..62c1f2f 100644
--- a/core/modules/views_ui/src/Tests/DisplayPathTest.php
+++ b/core/modules/views_ui/src/Tests/DisplayPathTest.php
@@ -70,9 +70,17 @@ public function doPathXssFilterTest() {
$this->drupalPostForm('admin/structure/views/nojs/display/test_view/page_2/path', array('path' => ''), t('Apply'));
$this->drupalPostForm(NULL, array(), 'Add Page');
$this->drupalPostForm('admin/structure/views/nojs/display/test_view/page_3/path', array('path' => ''), t('Apply'));
+ $this->drupalPostForm(NULL, array(), 'Add Page');
+ $this->drupalPostForm('admin/structure/views/nojs/display/test_view/page_4/path', array('path' => ''), t('Apply'));
$this->drupalPostForm('admin/structure/views/view/test_view', array(), t('Save'));
$this->drupalGet('admin/structure/views');
- $this->assertRaw('/<object>malformed_path</object>, /<script>alert("hello");</script>', 'Two paths were filtered for XSS.');
+ // The anchor text should be escaped.
+ $this->assertEscaped('/');
+ $this->assertEscaped('/');
+ $this->assertEscaped('/');
+ // Links should be url-encoded.
+ $this->assertRaw('/%3Cobject%3Emalformed_path%3C/object%3E');
+ $this->assertRaw('/%3Cscript%3Ealert%28%22hello%22%29%3B%3C/script%3E');
}
/**
diff --git a/core/modules/views_ui/tests/src/Unit/ViewListBuilderTest.php b/core/modules/views_ui/tests/src/Unit/ViewListBuilderTest.php
index 6ff910a..e51e681 100644
--- a/core/modules/views_ui/tests/src/Unit/ViewListBuilderTest.php
+++ b/core/modules/views_ui/tests/src/Unit/ViewListBuilderTest.php
@@ -92,7 +92,7 @@ public function testBuildRowEntityList() {
->will($this->onConsecutiveCalls(
$this->returnValue('test_page'),
$this->returnValue(''),
- $this->returnValue('placeholder_page/%')));
+ $this->returnValue('')));
$embed_display = $this->getMock('Drupal\views\Plugin\views\display\Embed', array('initDisplay'),
array(array(), 'default', $display_manager->getDefinition('embed'))
@@ -117,7 +117,7 @@ public function testBuildRowEntityList() {
$values['display']['page_3']['id'] = 'page_3';
$values['display']['page_3']['display_title'] = 'Page 3';
$values['display']['page_3']['display_plugin'] = 'page';
- $values['display']['page_3']['display_options']['path'] = 'placeholder_page/%';
+ $values['display']['page_3']['display_options']['path'] = '';
$values['display']['embed']['id'] = 'embed';
$values['display']['embed']['display_title'] = 'Embedded';
@@ -165,7 +165,7 @@ public function testBuildRowEntityList() {
$this->assertEquals($expected_displays, $row['data']['view_name']['data']['#displays']);
$display_paths = $row['data']['path']['data']['#context']['display_paths'];
- $this->assertEquals('/test_page, /<object>malformed_path</object>, /placeholder_page/%', implode(', ', $display_paths));
+ $this->assertEquals('/test_page, /<object>malformed_path</object>, /<script>alert("placeholder_page/%")</script>', implode(', ', $display_paths));
}
}