Skip to content

Commit

Permalink
Merge forwardport of #11058 to 2.3-develop branch
Browse files Browse the repository at this point in the history
Applied pull request patch https://github.com/magento/magento2/pull/11058.patch (created by @Quinten) based on commit(s):
  1. c3ea1f5
  2. 0c0393d
  3. d93173d
  • Loading branch information
magento-engcom-team authored Feb 5, 2018
2 parents ef5ddff + 5d174b8 commit 4ada797
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function testPrepareDataSource()
{
$itemName = 'itemName';
$oldItemValue = "itemValue\n";
$newItemValue = 'itemValue<br/>';
$newItemValue = "itemValue<br />\n";
$dataSource = [
'data' => [
'items' => [
Expand All @@ -57,7 +57,7 @@ public function testPrepareDataSource()
];

$this->model->setData('name', $itemName);
$this->escaper->expects($this->once())->method('escapeHtml')->with($newItemValue)->willReturnArgument(0);
$this->escaper->expects($this->any())->method('escapeHtml')->with($oldItemValue)->willReturnArgument(0);
$dataSource = $this->model->prepareDataSource($dataSource);
$this->assertEquals($newItemValue, $dataSource['data']['items'][0][$itemName]);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,7 @@ public function prepareDataSource(array $dataSource)
{
if (isset($dataSource['data']['items'])) {
foreach ($dataSource['data']['items'] as & $item) {
$item[$this->getData('name')] = $this->escaper->escapeHtml(
str_replace("\n", '<br/>', $item[$this->getData('name')])
);
$item[$this->getData('name')] = nl2br($this->escaper->escapeHtml($item[$this->getData('name')]));
}
}

Expand Down

0 comments on commit 4ada797

Please sign in to comment.