Skip to content

Commit 4ada797

Browse files
Merge forwardport of #11058 to 2.3-develop branch
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
2 parents ef5ddff + 5d174b8 commit 4ada797

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

app/code/Magento/Sales/Test/Unit/Ui/Component/Listing/Column/AddressTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function testPrepareDataSource()
4747
{
4848
$itemName = 'itemName';
4949
$oldItemValue = "itemValue\n";
50-
$newItemValue = 'itemValue<br/>';
50+
$newItemValue = "itemValue<br />\n";
5151
$dataSource = [
5252
'data' => [
5353
'items' => [
@@ -57,7 +57,7 @@ public function testPrepareDataSource()
5757
];
5858

5959
$this->model->setData('name', $itemName);
60-
$this->escaper->expects($this->once())->method('escapeHtml')->with($newItemValue)->willReturnArgument(0);
60+
$this->escaper->expects($this->any())->method('escapeHtml')->with($oldItemValue)->willReturnArgument(0);
6161
$dataSource = $this->model->prepareDataSource($dataSource);
6262
$this->assertEquals($newItemValue, $dataSource['data']['items'][0][$itemName]);
6363
}

app/code/Magento/Sales/Ui/Component/Listing/Column/Address.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,7 @@ public function prepareDataSource(array $dataSource)
4949
{
5050
if (isset($dataSource['data']['items'])) {
5151
foreach ($dataSource['data']['items'] as & $item) {
52-
$item[$this->getData('name')] = $this->escaper->escapeHtml(
53-
str_replace("\n", '<br/>', $item[$this->getData('name')])
54-
);
52+
$item[$this->getData('name')] = nl2br($this->escaper->escapeHtml($item[$this->getData('name')]));
5553
}
5654
}
5755

0 commit comments

Comments
 (0)