diff --git a/core/modules/node/src/Controller/NodeController.php b/core/modules/node/src/Controller/NodeController.php index 99765e8..bdab1d7 100644 --- a/core/modules/node/src/Controller/NodeController.php +++ b/core/modules/node/src/Controller/NodeController.php @@ -182,18 +182,47 @@ public function revisionOverview(NodeInterface $node) { '#theme' => 'username', '#account' => $revision_author, ); - $row[] = array('data' => SafeMarkup::set($this->t('!date by !username', array('!date' => $node->link($this->dateFormatter->format($revision->revision_timestamp->value, 'short')), '!username' => drupal_render($username))) - . (($revision->revision_log->value != '') ? '
' . Xss::filter($revision->revision_log->value) . '
' : '')), - 'class' => array('revision-current')); - $row[] = array('data' => SafeMarkup::placeholder($this->t('current revision')), 'class' => array('revision-current')); + $row[] = array( + 'data' => array( + '#type' => 'inline_template', + '#template' => '{{ author }}{% if message %}{{ message }}
{% endif %}', + '#context' => array( + 'author' => $this->t('!date by !username', + array( + '!date' => $node->link($this->dateFormatter->format($revision->revision_timestamp->value, 'short')), + '!username' => \Drupal::service('renderer')->render($username), + ) + ), + 'message' => Xss::filter($revision->revision_log->value), + ), + ), + 'class' => array('revision-current'), + ); + $row[] = array( + 'data' => SafeMarkup::placeholder($this->t('current revision')), + 'class' => array('revision-current'), + ); } else { $username = array( '#theme' => 'username', '#account' => $revision_author, ); - $row[] = SafeMarkup::set($this->t('!date by !username', array('!date' => $this->l($this->dateFormatter->format($revision->revision_timestamp->value, 'short'), new Url('node.revision_show', array('node' => $node->id(), 'node_revision' => $vid))), '!username' => drupal_render($username))) - . (($revision->revision_log->value != '') ? '' . Xss::filter($revision->revision_log->value) . '
' : '')); + $row[] = array( + 'data' => array( + '#type' => 'inline_template', + '#template' => '{{ author }}{% if message %}{{ message }}
{% endif %}', + '#context' => array( + 'author' => $this->t('!date by !username', + array( + '!date' => $this->l($this->dateFormatter->format($revision->revision_timestamp->value, 'short'), new Url('node.revision_show', array('node' => $node->id(), 'node_revision' => $vid))), + '!username' => \Drupal::service('renderer')->render($username), + ) + ), + 'message' => Xss::filter($revision->revision_log->value), + ), + ), + ); if ($revert_permission) { $links['revert'] = array( diff --git a/core/modules/node/src/Tests/NodeRevisionsUiTest.php b/core/modules/node/src/Tests/NodeRevisionsUiTest.php index 9159d79..3eb3ff5 100644 --- a/core/modules/node/src/Tests/NodeRevisionsUiTest.php +++ b/core/modules/node/src/Tests/NodeRevisionsUiTest.php @@ -122,7 +122,7 @@ function testNodeRevisionDoubleEscapeFix() { 'format' => filter_default_format(), ); $node->setNewRevision(); - $node->revision_log->value = 'Revision message'; + $node->revision_log->value = 'Revision message with markup.'; $node->save(); $node = Node::load($node->id()); // Make sure we get revision information. $nodes[] = clone $node;