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