4
4
* See COPYING.txt for license details.
5
5
*/
6
6
7
- // @codingStandardsIgnoreFile
8
-
7
+ // phpcs:disable Magento2.Templates.ThisInTemplate.FoundThis
9
8
?>
10
9
<?php
11
10
/**
14
13
* @var $block \Magento\CatalogSearch\Block\Advanced\Form
15
14
*/
16
15
?>
17
- <?php $ maxQueryLength = $ this ->helper (' Magento\CatalogSearch\Helper\Data ' )->getMaxQueryLength ();?>
18
- <form class="form search advanced" action="<?= /* @escapeNotVerified */ $ block ->getSearchPostUrl () ?> " method="get" id="form-validate">
16
+ <?php $ maxQueryLength = $ this ->helper (\ Magento \CatalogSearch \Helper \Data::class )->getMaxQueryLength ();?>
17
+ <form class="form search advanced" action="<?= $ block ->escapeUrl ( $ block -> getSearchPostUrl () ) ?> " method="get" id="form-validate">
19
18
<fieldset class="fieldset">
20
- <legend class="legend"><span><?= /* @escapeNotVerified */ __ ('Search Settings ' ) ?> </span></legend><br />
21
- <?php foreach ($ block ->getSearchableAttributes () as $ _attribute ): ?>
22
- <?php $ _code = $ _attribute ->getAttributeCode () ?>
23
- <div class="field <?= /* @escapeNotVerified */ $ _code ?> ">
24
- <label class="label" for="<?= /* @escapeNotVerified */ $ _code ?> ">
19
+ <legend class="legend"><span><?= $ block -> escapeHtml ( __ ('Search Settings ' ) ) ?> </span></legend><br />
20
+ <?php foreach ($ block ->getSearchableAttributes () as $ _attribute ) : ?>
21
+ <?php $ _code = $ _attribute ->getAttributeCode () ?>
22
+ <div class="field <?= $ block -> escapeHtmlAttr ( $ _code) ?> ">
23
+ <label class="label" for="<?= $ block -> escapeHtmlAttr ( $ _code) ?> ">
25
24
<span><?= $ block ->escapeHtml (__ ($ block ->getAttributeLabel ($ _attribute ))) ?> </span>
26
25
</label>
27
26
<div class="control">
28
- <?php switch ($ block ->getAttributeInputType ($ _attribute )):
29
- case 'number ' : ?>
27
+ <?php
28
+ switch ($ block ->getAttributeInputType ($ _attribute )) :
29
+ case 'number ' :
30
+ ?>
30
31
<div class="range fields group group-2">
31
32
<div class="field no-label">
32
33
<div class="control">
33
34
<input type="text"
34
- name="<?= /* @escapeNotVerified */ $ _code ?> [from]"
35
+ name="<?= $ block -> escapeHtmlAttr ( $ _code) ?> [from]"
35
36
value="<?= $ block ->escapeHtml ($ block ->getAttributeValue ($ _attribute , 'from ' )) ?> "
36
- id="<?= /* @escapeNotVerified */ $ _code ?> "
37
+ id="<?= $ block -> escapeHtmlAttr ( $ _code) ?> "
37
38
title="<?= $ block ->escapeHtml ($ block ->getAttributeLabel ($ _attribute )) ?> "
38
39
class="input-text"
39
- maxlength="<?= /* @escapeNotVerified */ $ maxQueryLength ?> "
40
- data-validate="{number:true, 'less-than-equals-to':'#<?= /* @escapeNotVerified */ $ _code ?> _to'}" />
40
+ maxlength="<?= $ block -> escapeHtmlAttr ( $ maxQueryLength) ?> "
41
+ data-validate="{number:true, 'less-than-equals-to':'#<?= $ block -> escapeHtmlAttr ( $ _code) ?> _to'}" />
41
42
</div>
42
43
</div>
43
44
<div class="field no-label">
44
45
<div class="control">
45
46
<input type="text"
46
- name="<?= /* @escapeNotVerified */ $ _code ?> [to]"
47
+ name="<?= $ block -> escapeHtmlAttr ( $ _code) ?> [to]"
47
48
value="<?= $ block ->escapeHtml ($ block ->getAttributeValue ($ _attribute , 'to ' )) ?> "
48
- id="<?= /* @escapeNotVerified */ $ _code ?> _to"
49
+ id="<?= $ block -> escapeHtmlAttr ( $ _code) ?> _to"
49
50
title="<?= $ block ->escapeHtml ($ block ->getAttributeLabel ($ _attribute )) ?> "
50
51
class="input-text"
51
- maxlength="<?= /* @escapeNotVerified */ $ maxQueryLength ?> "
52
- data-validate="{number:true, 'greater-than-equals-to':'#<?= /* @escapeNotVerified */ $ _code ?> '}" />
52
+ maxlength="<?= $ block -> escapeHtmlAttr ( $ maxQueryLength) ?> "
53
+ data-validate="{number:true, 'greater-than-equals-to':'#<?= $ block -> escapeHtmlAttr ( $ _code) ?> '}" />
53
54
</div>
54
55
</div>
55
56
</div>
56
- <?php break ;
57
- case 'price ' : ?>
57
+ <?php
58
+ break ;
59
+ case 'price ' :
60
+ ?>
58
61
<div class="range price fields group group-2">
59
62
<div class="field no-label">
60
63
<div class="control">
61
- <input name="<?= /* @escapeNotVerified */ $ _code ?> [from]"
64
+ <input name="<?= $ block -> escapeHtmlAttr ( $ _code) ?> [from]"
62
65
value="<?= $ block ->escapeHtml ($ block ->getAttributeValue ($ _attribute , 'from ' )) ?> "
63
- id="<?= /* @escapeNotVerified */ $ _code ?> "
66
+ id="<?= $ block -> escapeHtmlAttr ( $ _code) ?> "
64
67
title="<?= $ block ->escapeHtml ($ block ->getAttributeLabel ($ _attribute )) ?> "
65
68
class="input-text"
66
69
type="text"
67
- maxlength="<?= /* @escapeNotVerified */ $ maxQueryLength ?> "
68
- data-validate="{number:true, 'less-than-equals-to':'#<?= /* @escapeNotVerified */ $ _code ?> _to'}" />
70
+ maxlength="<?= $ block -> escapeHtmlAttr ( $ maxQueryLength) ?> "
71
+ data-validate="{number:true, 'less-than-equals-to':'#<?= $ block -> escapeHtmlAttr ( $ _code) ?> _to'}" />
69
72
</div>
70
73
</div>
71
74
<div class="field with-addon no-label">
72
75
<div class="control">
73
76
<div class="addon">
74
- <input name="<?= /* @escapeNotVerified */ $ _code ?> [to]"
77
+ <input name="<?= $ block -> escapeHtmlAttr ( $ _code) ?> [to]"
75
78
value="<?= $ block ->escapeHtml ($ block ->getAttributeValue ($ _attribute , 'to ' )) ?> "
76
- id="<?= /* @escapeNotVerified */ $ _code ?> _to"
79
+ id="<?= $ block -> escapeHtmlAttr ( $ _code) ?> _to"
77
80
title="<?= $ block ->escapeHtml ($ block ->getAttributeLabel ($ _attribute )) ?> "
78
81
class="input-text"
79
82
type="text"
80
- maxlength="<?= /* @escapeNotVerified */ $ maxQueryLength ?> "
81
- data-validate="{number:true, 'greater-than-equals-to':'#<?= /* @escapeNotVerified */ $ _code ?> '}" />
83
+ maxlength="<?= $ block -> escapeHtmlAttr ( $ maxQueryLength) ?> "
84
+ data-validate="{number:true, 'greater-than-equals-to':'#<?= $ block -> escapeHtmlAttr ( $ _code) ?> '}" />
82
85
<label class="addafter"
83
- for="<?= /* @escapeNotVerified */ $ _code ?> _to">
84
- <?= /* @escapeNotVerified */ $ block ->getCurrency ($ _attribute ) ?>
86
+ for="<?= $ block -> escapeHtmlAttr ( $ _code) ?> _to">
87
+ <?= $ block ->escapeHtml ( $ block -> getCurrency ($ _attribute) ) ?>
85
88
</label>
86
89
</div>
87
90
</div>
88
91
</div>
89
92
</div>
90
- <?php break ;
91
- case 'select ' : ?>
92
- <?= /* @escapeNotVerified */ $ block ->getAttributeSelectElement ($ _attribute ) ?>
93
- <?php break ;
94
- case 'yesno ' : ?>
95
- <?= /* @escapeNotVerified */ $ block ->getAttributeYesNoElement ($ _attribute ) ?>
96
- <?php break ;
97
- case 'date ' : ?>
93
+ <?php
94
+ break ;
95
+ case 'select ' :
96
+ ?>
97
+ <?= /* @noEscape */ $ block ->getAttributeSelectElement ($ _attribute ) ?>
98
+ <?php
99
+ break ;
100
+ case 'yesno ' :
101
+ ?>
102
+ <?= /* @noEscape */ $ block ->getAttributeYesNoElement ($ _attribute ) ?>
103
+ <?php
104
+ break ;
105
+ case 'date ' :
106
+ ?>
98
107
<div class="range dates fields group group-2">
99
108
<div class="field date no-label">
100
109
<div class="control">
101
- <?= /* @escapeNotVerified */ $ block ->getDateInput ($ _attribute , 'from ' ) ?>
110
+ <?= /* @noEscape */ $ block ->getDateInput ($ _attribute , 'from ' ) ?>
102
111
</div>
103
112
</div>
104
113
<div class="field date no-label">
105
114
<div class="control">
106
- <?= /* @escapeNotVerified */ $ block ->getDateInput ($ _attribute , 'to ' ) ?>
115
+ <?= /* @noEscape */ $ block ->getDateInput ($ _attribute , 'to ' ) ?>
107
116
</div>
108
117
</div>
109
118
</div>
110
- <?php break ;
111
- default : ?>
119
+ <?php
120
+ break ;
121
+ default :
122
+ ?>
112
123
<input type="text"
113
- name="<?= /* @escapeNotVerified */ $ _code ?> "
114
- id="<?= /* @escapeNotVerified */ $ _code ?> "
124
+ name="<?= $ block -> escapeHtmlAttr ( $ _code) ?> "
125
+ id="<?= $ block -> escapeHtmlAttr ( $ _code) ?> "
115
126
value="<?= $ block ->escapeHtml ($ block ->getAttributeValue ($ _attribute )) ?> "
116
127
title="<?= $ block ->escapeHtml ($ block ->getAttributeLabel ($ _attribute )) ?> "
117
- class="input-text <?= /* @escapeNotVerified */ $ block ->getAttributeValidationClass ($ _attribute ) ?> "
118
- maxlength="<?= /* @escapeNotVerified */ $ maxQueryLength ?> " />
128
+ class="input-text <?= $ block ->escapeHtmlAttr ( $ block -> getAttributeValidationClass ($ _attribute) ) ?> "
129
+ maxlength="<?= $ block -> escapeHtmlAttr ( $ maxQueryLength) ?> " />
119
130
<?php endswitch ; ?>
120
131
</div>
121
132
</div>
126
137
<button type="submit"
127
138
class="action search primary"
128
139
title="<?= $ block ->escapeHtml (__ ('Search ' )) ?> ">
129
- <span><?= /* @escapeNotVerified */ __ ('Search ' ) ?> </span>
140
+ <span><?= $ block -> escapeHtml ( __ ('Search ' ) ) ?> </span>
130
141
</button>
131
142
</div>
132
143
</div>
@@ -147,8 +158,8 @@ require([
147
158
}
148
159
},
149
160
messages: {
150
- 'price[to]': {'greater-than-equals-to': '<?= /* @escapeNotVerified */ __ ('Please enter a valid price range. ' ) ?> '},
151
- 'price[from]': {'less-than-equals-to': '<?= /* @escapeNotVerified */ __ ('Please enter a valid price range. ' ) ?> '}
161
+ 'price[to]': {'greater-than-equals-to': '<?= $ block -> escapeJs ( __ ('Please enter a valid price range. ' ) ) ?> '},
162
+ 'price[from]': {'less-than-equals-to': '<?= $ block -> escapeJs ( __ ('Please enter a valid price range. ' ) ) ?> '}
152
163
}
153
164
});
154
165
});
0 commit comments