Skip to content

Commit d93173d

Browse files
author
Quinten Clause
committed
Escape html before replace new line with break
Fixes #10330 Multiline addresses are stored in the database with new lines The new lines were replaced and then escaped (in the wrong order) so the breaks were rendered as htmlentities <br /> became &lt;br /&gt;
1 parent 0c0393d commit d93173d

File tree

1 file changed

+1
-3
lines changed
  • app/code/Magento/Sales/Ui/Component/Listing/Column

1 file changed

+1
-3
lines changed

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)