only in patch2:
unchanged:
--- a/core/modules/views/src/Plugin/views/HandlerBase.php
+++ b/core/modules/views/src/Plugin/views/HandlerBase.php
@@ -181,8 +181,7 @@ protected function defineOptions() {
*/
public function adminLabel($short = FALSE) {
if (!empty($this->options['admin_label'])) {
- $title = SafeMarkup::checkPlain($this->options['admin_label']);
- return $title;
+ return $this->options['admin_label'];
}
$title = ($short && isset($this->definition['title short'])) ? $this->definition['title short'] : $this->definition['title'];
return $this->t('!group: !title', array('!group' => $this->definition['group'], '!title' => $title));
@@ -230,10 +229,10 @@ public function sanitizeValue($value, $type = NULL) {
$value = Xss::filterAdmin($value);
break;
case 'url':
- $value = SafeMarkup::checkPlain(UrlHelper::stripDangerousProtocols($value));
+ $value = Html::escape(UrlHelper::stripDangerousProtocols($value));
break;
default:
- $value = SafeMarkup::checkPlain($value);
+ $value = Html::escape($value);
break;
}
return $value;
only in patch2:
unchanged:
--- a/core/modules/views/src/Plugin/views/row/EntityRow.php
+++ b/core/modules/views/src/Plugin/views/row/EntityRow.php
@@ -160,7 +160,7 @@ public function buildOptionsForm(&$form, FormStateInterface $form_state) {
public function summaryTitle() {
$options = \Drupal::entityManager()->getViewModeOptions($this->entityTypeId);
if (isset($options[$this->options['view_mode']])) {
- return SafeMarkup::checkPlain($options[$this->options['view_mode']]);
+ return $options[$this->options['view_mode']];
}
else {
return $this->t('No view mode selected');
only in patch2:
unchanged:
--- a/core/modules/views_ui/src/Tests/RowUITest.php
+++ b/core/modules/views_ui/src/Tests/RowUITest.php
@@ -7,6 +7,7 @@
namespace Drupal\views_ui\Tests;
+use Drupal\Core\Entity\Entity\EntityViewMode;
use Drupal\views\Views;
/**
@@ -87,6 +88,13 @@ public function testRowUI() {
$this->drupalPostForm(NULL, ['row[type]' => 'entity:node'], t('Apply'));
$this->assertUrl($row_options_url);
$this->assertFieldByName('row_options[view_mode]', 'teaser');
+
+ // Change the teaser label to have markup so we can test escaping.
+ $teaser = EntityViewMode::load('node.teaser');
+ $teaser->set('label', 'Teaser markup');
+ $teaser->save();
+ $this->drupalGet('admin/structure/views/view/frontpage/edit/default');
+ $this->assertEscaped('Teaser markup');
}
}