-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Description
Preconditions (*)
1.Magento 2.3.2
Steps to reproduce (*)
1.in vendor\magento\module-sales\view\adminhtml\templates\items\column\name.phtml line 33
<?php $_option = $block->getFormattedOption($_option['value']); ?>
<?php $dots = 'dots' . uniqid(); ?>
<?= $block->escapeHtml($_option['value']) ?>
-
the class of $block is vendor\magento\module-sales\Block\Adminhtml\Items\Column\Name.php
public function getFormattedOption($value)
{
$remainder = '';
$this->truncateString($value, 55, '', $remainder);
$result = [
'value' => nl2br($this->truncateResult->getValue()),
'remainder' => nl2br($this->truncateResult->getRemainder())
];
return $result;
} -
problem:
in name.phtml, "
" may be added in getFormattedOption, then "
" is escaped by
$block->escapeHtml
Expected result (*)
-
maybe, you can call with parameter $allowedTags like this
escapeHtml($_option['value'], ['br']) ?> -
Actually, this issue exists in many template files.
Actual result (*)
Lens Options: Single Vision Distance (SVD);<br /> Index: 1.5;<br /> Seg Heigh t: 50;<br /> Right DPD: 40;<br /> Left DPD: 40.