Skip to content

Commit f02071e

Browse files
authored
Merge pull request #35 from magento-lynx/MC-41904
MC-41904: Fix HTML tags not properly nested/closed [core]
2 parents 8b57fea + 5955a29 commit f02071e

File tree

134 files changed

+548
-330
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

134 files changed

+548
-330
lines changed

app/code/Magento/AdminNotification/view/adminhtml/web/js/grid/columns/message.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,16 @@ define([
3636
return record[this.messageIndex];
3737
},
3838

39+
/**
40+
* Proxy to getLabel function with UnsanitizedHtml suffix
41+
*
42+
* @param {Object} record
43+
* @returns {String}
44+
*/
45+
getLabelUnsanitizedHtml: function (record) {
46+
return this.getLabel(record);
47+
},
48+
3949
/** @inheritdoc */
4050
getFieldClass: function ($row) {
4151
var status = this.statusMap[$row.status] || 'warning',

app/code/Magento/AdminNotification/view/adminhtml/web/template/grid/cells/message.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
*/
66
-->
77
<div css="$col.getFieldClass($row())"
8-
html="$col.getLabel($row())"/>
8+
html="$col.getLabelUnsanitizedHtml($row())"></div>

app/code/Magento/AsynchronousOperations/view/adminhtml/web/template/form/field.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
-->
77
<div css="$data.additionalClasses"
88
if="error"
9-
text="error"/>
9+
text="error"></div>

app/code/Magento/AsynchronousOperations/view/adminhtml/web/template/grid/cells/actions.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@
1111
attr="{
1212
title: $action().label
1313
}"
14-
/>
14+
></button>
1515
</div>

app/code/Magento/AsynchronousOperations/view/adminhtml/web/template/grid/listing.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@
3131
<a class="action__message-log"
3232
href="#"
3333
click="dismissAll"
34-
text="dismissAllText"/>
34+
text="dismissAllText"></a>
3535
<a class="action__message-log"
3636
attr="{
3737
href: link
3838
}"
39-
text="linkText"/>
39+
text="linkText"></a>
4040
</div>
4141
</div>
4242
</div>

app/code/Magento/Backend/view/adminhtml/web/template/dynamic-rows/grid.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
class="action-secondary"
1717
type="button"
1818
click="processingAddChild.bind($data, false, false, false)">
19-
<span translate="addButtonLabel"/>
19+
<span translate="addButtonLabel"></span>
2020
</button>
2121
</div>
2222

@@ -30,7 +30,7 @@
3030
css="$data.setClasses($data)"
3131
attr="'data-index': index">
3232
<label if="$data.label" class="admin__field-label" attr="for: $data.uid">
33-
<span translate="$data.label"/>
33+
<span translate="$data.label"></span>
3434
</label>
3535

3636
<div class="admin__field-control" data-role="grid-wrapper">
@@ -47,14 +47,14 @@
4747
<thead if="element.columnsHeader">
4848
<tr>
4949
<th if="$data.dndConfig.enabled"
50-
class="data-grid-draggable-row-cell"/>
50+
class="data-grid-draggable-row-cell"></th>
5151

5252
<th repeat="foreach: labels, item: '$label'"
5353
class="data-grid-th"
5454
visible="$label().visible"
5555
disable="$label().disabled"
5656
css="setClasses($label())">
57-
<span translate="$label().label"/>
57+
<span translate="$label().label"></span>
5858
</th>
5959
</tr>
6060
</thead>
@@ -65,15 +65,15 @@
6565
css="'_odd-row': $index % 2">
6666
<td if="dndConfig.enabled"
6767
class="data-grid-draggable-row-cell"
68-
template="name: dndConfig.template, data: dnd"/>
68+
template="name: dndConfig.template, data: dnd"></td>
6969

7070
<!-- ko foreach: { data: $record().elems(), as: 'elem'} -->
7171
<td if="elem.template"
7272
visible="elem.visible() && elem.formElement !== 'hidden'"
7373
disable="elem.disabled"
7474
css="$parent.setClasses(elem)"
7575
template="elem.template"
76-
attr="'data-index': index"/>
76+
attr="'data-index': index"></td>
7777
<!-- /ko -->
7878
</tr>
7979
</tbody>

app/code/Magento/Bundle/view/adminhtml/templates/product/composite/fieldset/options/type/radio.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
class="input-text admin__control-text qty validate-greater-than-zero<?php if (!$_canChangeQty) { echo ' qty-disabled'; } ?>"
7070
type="text"
7171
name="bundle_option_qty[<?= $block->escapeHtmlAttr($_option->getId()) ?>]"
72-
value="<?= $block->escapeHtmlAttr($_defaultQty) ?>" />
72+
value="<?= $block->escapeHtmlAttr($_defaultQty) ?>"></div>
7373
</div>
7474
</div>
7575
</div>

app/code/Magento/Bundle/view/base/web/template/product/price/minimal_price.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
css="getAdjustmentCssClasses($row())">
1010
<span if="label"
1111
class="price-label"
12-
text="label"/>
12+
text="label"></span>
1313

1414
<span class="price-wrapper"
1515
css="priceWrapperCssClasses"
1616
attr="priceWrapperAttr"
1717
data-price-amount=""
1818
data-price-type=""
19-
html="getMinimalPrice($row())"/>
19+
html="getMinimalPriceUnsanitizedHtml($row())"></span>
2020

2121
<each args="data: getAdjustments(), as: '$adj'">
2222
<render args="$adj.getBody()"/>

app/code/Magento/Catalog/view/adminhtml/web/template/attributes/grid/paging.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
-->
77
<ul class="admin__control-support-text attributes-summary">
88
<li class="attributes-selected">
9-
<span translate="'Selected Attributes\:'"/>
10-
<span text="label"/>
9+
<span translate="'Selected Attributes\:'"></span>
10+
<span text="label"></span>
1111
</li>
1212
<li class="attributes-found">
1313
<text args="totalRecords"/> records found

app/code/Magento/Catalog/view/adminhtml/web/template/form/element/frontend-input-select.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
optionsCaption: caption,
1818
optionsValue: 'value',
1919
optionsText: 'label'"
20-
/>
20+
></select>
2121
<div class="admin__field-note" if="$data.hints">
22-
<span translate="$data.hints[$data.value()]"/>
22+
<span translate="$data.hints[$data.value()]"></span>
2323
</div>

app/code/Magento/Catalog/view/adminhtml/web/template/form/element/input.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@
1717
id: uid,
1818
disabled: disabled
1919
}"/>
20-
<label class="admin__field-error" if="error" attr="for: uid" text="error"/>
20+
<label class="admin__field-error" if="error" attr="for: uid" text="error"></label>

app/code/Magento/Catalog/view/adminhtml/web/template/form/field.html

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
css="$data.additionalClasses"
1010
attr="'data-index': index">
1111
<label class="admin__field-label" if="$data.label" visible="$data.labelVisible" attr="for: uid">
12-
<span translate="label" attr="'data-config-scope': $data.scopeLabel"/>
12+
<span translate="label" attr="'data-config-scope': $data.scopeLabel"></span>
1313
</label>
1414
<div class="admin__field-control"
1515
css="'_with-tooltip': $data.tooltip, '_with-reset': $data.showFallbackReset && $data.isDifferedFromDefault">
@@ -19,24 +19,28 @@
1919
<render args="elementTmpl"/>
2020

2121
<label class="admin__addon-prefix" if="addBefore()" attr="for: uid">
22-
<span text="addBefore()"/>
22+
<span text="addBefore()"></span>
2323
</label>
2424
<label class="admin__addon-suffix" if="$data.addafter" attr="for: uid">
25-
<span text="addafter"/>
25+
<span text="addafter"></span>
2626
</label>
2727
</div>
2828

2929
<render args="tooltipTpl" if="$data.tooltip"/>
3030

3131
<render args="fallbackResetTpl" if="$data.showFallbackReset && $data.isDifferedFromDefault"/>
3232

33-
<label class="admin__field-error" if="error" attr="for: uid" text="error"/>
33+
<label class="admin__field-error" if="error" attr="for: uid" text="error"></label>
3434

3535
<div class="admin__field-note" if="$data.notice" attr="id: noticeId">
36-
<span translate="notice"/>
36+
<span translate="notice"></span>
3737
</div>
3838

39-
<div class="admin__additional-info" if="$data.additionalInfo" html="$data.additionalInfo"></div>
39+
<!-- ko if: $data.additionalInfo -->
40+
<!-- ko with: {additionalInfoUnsanitizedHtml: $data.additionalInfo} -->
41+
<div class="admin__additional-info" html="additionalInfoUnsanitizedHtml"></div>
42+
<!-- /ko -->
43+
<!-- /ko -->
4044

4145
<render args="$data.service.template" if="$data.hasService()"/>
4246
</div>

app/code/Magento/Catalog/view/adminhtml/web/template/grid/cells/preserved.html

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-
<div class="data-grid-cell-content white-space-preserved" html="$col.getLabel($row())"/>
7+
<div class="data-grid-cell-content white-space-preserved" html="$col.getLabelUnsanitizedHtml($row())"></div>

app/code/Magento/Catalog/view/adminhtml/web/template/image-preview.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<div class="file-uploader-summary">
88
<div class="file-uploader-preview image-uploader-preview">
99
<a class="image-uploader-preview-link" attr="href: $parent.getFilePreview($file)" target="_blank">
10-
<div class="file-uploader-spinner image-uploader-spinner" />
10+
<div class="file-uploader-spinner image-uploader-spinner"></div>
1111
<img
1212
class="preview-image"
1313
tabindex="0"
@@ -26,12 +26,12 @@
2626
attr="title: $t('Delete image')"
2727
disable="$parent.disabled"
2828
click="$parent.removeFile.bind($parent, $file)">
29-
<span translate="'Delete image'"/>
29+
<span translate="'Delete image'"></span>
3030
</button>
3131
</div>
3232
</div>
3333

34-
<div class="file-uploader-filename" text="$file.name"/>
34+
<div class="file-uploader-filename" text="$file.name"></div>
3535
<div class="file-uploader-meta">
3636
<text args="$file.previewWidth"/>x<text args="$file.previewHeight"/>,
3737
<text args="$parent.formatSize($file.size)"/>

app/code/Magento/Catalog/view/base/web/js/product/list/columns/final-price.js

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,16 @@ define([
3232
return row['price_info']['formatted_prices']['final_price'];
3333
},
3434

35+
/**
36+
* UnsanitizedHtml version of getPrice.
37+
*
38+
* @param {Object} row
39+
* @return {HTMLElement} final price html
40+
*/
41+
getPriceUnsanitizedHtml: function (row) {
42+
return this.getPrice(row);
43+
},
44+
3545
/**
3646
* Get product regular price.
3747
*
@@ -42,6 +52,16 @@ define([
4252
return row['price_info']['formatted_prices']['regular_price'];
4353
},
4454

55+
/**
56+
* UnsanitizedHtml version of getRegularPrice.
57+
*
58+
* @param {Object} row
59+
* @return {HTMLElement} regular price html
60+
*/
61+
getRegularPriceUnsanitizedHtml: function (row) {
62+
return this.getRegularPrice(row);
63+
},
64+
4565
/**
4666
* Check if product has a price range.
4767
*
@@ -82,6 +102,16 @@ define([
82102
return row['price_info']['formatted_prices']['minimal_price'];
83103
},
84104

105+
/**
106+
* UnsanitizedHtml version of getMinimalPrice.
107+
*
108+
* @param {Object} row
109+
* @return {HTMLElement} minimal price html
110+
*/
111+
getMinimalPriceUnsanitizedHtml: function (row) {
112+
return this.getMinimalPrice(row);
113+
},
114+
85115
/**
86116
* Check if product is salable.
87117
*
@@ -102,6 +132,16 @@ define([
102132
return row['price_info']['formatted_prices']['max_price'];
103133
},
104134

135+
/**
136+
* UnsanitizedHtml version of getMaxPrice.
137+
*
138+
* @param {Object} row
139+
* @return {HTMLElement} maximum price html
140+
*/
141+
getMaxPriceUnsanitizedHtml: function (row) {
142+
return this.getMaxPrice(row);
143+
},
144+
105145
/**
106146
* Get product maximum regular price in case of price range and special price.
107147
*
@@ -112,6 +152,16 @@ define([
112152
return row['price_info']['formatted_prices']['max_regular_price'];
113153
},
114154

155+
/**
156+
* UnsanitizedHtml version of getMaxRegularPrice.
157+
*
158+
* @param {Object} row
159+
* @return {HTMLElement} maximum regular price html
160+
*/
161+
getMaxRegularPriceUnsanitizedHtml: function (row) {
162+
return this.getMaxRegularPrice(row);
163+
},
164+
115165
/**
116166
* Get product minimal regular price in case of price range and special price.
117167
*
@@ -122,6 +172,16 @@ define([
122172
return row['price_info']['formatted_prices']['min_regular_price'];
123173
},
124174

175+
/**
176+
* UnsanitizedHtml version of getMinRegularPrice.
177+
*
178+
* @param {Object} row
179+
* @return {HTMLElement} minimal regular price html
180+
*/
181+
getMinRegularPriceUnsanitizedHtml: function (row) {
182+
return this.getMinRegularPrice(row);
183+
},
184+
125185
/**
126186
* Get adjustments names and return as string.
127187
*
@@ -141,6 +201,16 @@ define([
141201
return row['price_info']['minimal_price'];
142202
},
143203

204+
/**
205+
* UnsanitizedHtml version of getMinimalPriceAmount
206+
*
207+
* @param {Object} row
208+
* @return {Number} minimal price amount
209+
*/
210+
getMinimalPriceAmountUnsanitizedHtml: function (row) {
211+
return this.getMinimalPriceAmount(row);
212+
},
213+
144214
/**
145215
* Get product minimal regular price as number in case of special price.
146216
*

app/code/Magento/Catalog/view/base/web/template/product/link.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77
<a if="isAllowed()"
88
class="product-item-link"
99
attr="href: $row().url"
10-
text="label"/>
10+
text="label"></a>

app/code/Magento/Catalog/view/base/web/template/product/list/listing.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<div class="block-title">
1010
<strong role="heading"
1111
aria-level="2"
12-
text="label"/>
12+
text="label"></strong>
1313
</div>
1414
<div class="block-content">
1515
<div css="'products-' + displayMode">

app/code/Magento/Catalog/view/base/web/template/product/name.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66
-->
77
<strong if="isAllowed()"
88
class="product-item-name">
9-
<a attr="href: $row().url" html="getNameUnsanitizedHtml($col.getLabel($row()))"/>
9+
<a attr="href: $row().url" html="getNameUnsanitizedHtml($col.getLabel($row()))"></a>
1010
</strong>

app/code/Magento/Catalog/view/base/web/template/product/price/max_price.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
css="getAdjustmentCssClasses($row())">
1010
<span if="label"
1111
class="price-label"
12-
text="label"/>
12+
text="label"></span>
1313

1414
<span class="price-wrapper"
1515
css="priceWrapperCssClasses"
1616
attr="priceWrapperAttr"
1717
data-price-amount=""
1818
data-price-type=""
19-
html="getMaxPrice($row())"/>
19+
html="getMaxPriceUnsanitizedHtml($row())"></span>
2020

2121
<each args="data: getAdjustments('max_price'), as: '$adj'">
2222
<render args="$adj.getBody()"/>

0 commit comments

Comments
 (0)