Skip to content

Commit b1d1e1b

Browse files
author
Hwashiang Yu
committed
MAGETWO-56444: UI-Related Modules Template Update
- Resolved incorrectly escaped templates
1 parent 5fa9178 commit b1d1e1b

File tree

6 files changed

+13
-13
lines changed

6 files changed

+13
-13
lines changed

app/code/Magento/Theme/view/adminhtml/templates/tabs/fieldset/js.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ jQuery(function($) {
6262
$('body').trigger(
6363
'refreshJsList',
6464
{
65-
jsList: <?= $block->escapeJs($this->helper('Magento\Framework\Json\Helper\Data')->jsonEncode($block->getJsFiles())) ?>
65+
jsList: <?= /* @noEscape */ $this->helper('Magento\Framework\Json\Helper\Data')->jsonEncode($block->getJsFiles()) ?>
6666
}
6767
);
6868
});

app/code/Magento/Theme/view/frontend/templates/html/absolute_footer.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
* See COPYING.txt for license details.
55
*/
66
?>
7-
<?= $block->getMiscellaneousHtml();
7+
<?= /* @noEscape */ $block->getMiscellaneousHtml();

app/code/Magento/Theme/view/frontend/templates/html/header/logo.phtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ $storeName = $block->getThemeName() ? $block->getThemeName() : $block->getLogoAl
2020
<img src="<?= $block->escapeUrl($block->getLogoSrc()) ?>"
2121
title="<?= $block->escapeHtmlAttr($block->getLogoAlt()) ?>"
2222
alt="<?= $block->escapeHtmlAttr($block->getLogoAlt()) ?>"
23-
<?= $block->escapeHtml($block->getLogoWidth() ? 'width="' . $block->getLogoWidth() . '"' : '') ?>
24-
<?= $block->escapeHtml($block->getLogoHeight() ? 'height="' . $block->getLogoHeight() . '"' : '') ?>
23+
<?= $block->getLogoWidth() ? 'width="' . $block->escapeHtmlAttr($block->getLogoWidth()) . '"' : '' ?>
24+
<?= $block->getLogoHeight() ? 'height="' . $block->escapeHtmlAttr($block->getLogoHeight()) . '"' : '' ?>
2525
/>
2626
</a>

app/code/Magento/Theme/view/frontend/templates/text.phtml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@
44
* See COPYING.txt for license details.
55
*/
66

7-
$attributes = $block->getCssClass() ? ' class="' . $block->getCssClass() . '"' : '';
7+
// @codingStandardsIgnoreFile
8+
9+
$attributes = $block->getCssClass() ? ' class="' . $block->escapeHtmlAttr($block->getCssClass()) . '"' : '';
810
$attr = $block->getAttributes();
911
if (!empty($attr)) {
1012
foreach ($block->getAttributes() as $attribute => $value) {
11-
$attributes .= ' ' . $attribute . '="' . $value . '"';
13+
$attributes .= ' ' . $block->escapeHtml($attribute) . '="' . $block->escapeHtmlAttr($value) . '"';
1214
}
1315
}
14-
?>
15-
<?=
16-
'<'
16+
/* @noEscape */ echo '<'
1717
. $block->escapeHtml($block->getTag())
18-
. $block->escapeHtml($attributes)
18+
. $attributes
1919
. '>'
2020
. $block->escapeHtml($block->getText())
2121
. '</'

app/code/Magento/Ui/view/base/templates/form/default.phtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* @var \Magento\Ui\Component\Form $block
99
*/
1010
?>
11-
<?= $block->escapeHtml($block->renderChildComponent('before_form')) ?>
11+
<?=/* @noEscape */ $block->renderChildComponent('before_form') ?>
1212
<div data-role="spinner"
1313
data-component="<?= $block->escapeHtmlAttr($block->getName()) ?>.areas"
1414
class="admin__data-grid-loading-mask">
@@ -18,4 +18,4 @@
1818
class="entry-edit form-inline">
1919
<!-- ko template: getTemplate() --><!-- /ko -->
2020
</div>
21-
<?= $block->escapeHtml($block->renderChildComponent('after_form')) ?>
21+
<?= /* @noEscape */ $block->renderChildComponent('after_form') ?>

app/code/Magento/Ui/view/base/templates/logger.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<?php if ($block->isLoggingEnabled()): ?>
1212
<script>
1313
window.onerror = function(msg, url, line) {
14-
var key = "<?= $block->escapeHtmlAttr($block->getSessionStorageKey()) ?>";
14+
var key = "<?= $block->escapeJs($block->getSessionStorageKey()) ?>";
1515
var errors = {};
1616
if (sessionStorage.getItem(key)) {
1717
errors = JSON.parse(sessionStorage.getItem(key));

0 commit comments

Comments
 (0)