7
7
8
8
namespace Magento \PageBuilder \Plugin \Filter ;
9
9
10
- use Magento \Store \Model \Store ;
11
-
12
10
/**
13
11
* Plugin to the template filter to process any background images added by Page Builder
14
12
*/
@@ -18,11 +16,6 @@ class TemplatePlugin
18
16
19
17
const HTML_CONTENT_TYPE_PATTERN = '/data-content-type="html"/si ' ;
20
18
21
- /**
22
- * @var \Magento\Framework\Escaper
23
- */
24
- private $ escaper ;
25
-
26
19
/**
27
20
* @var \Magento\Framework\View\ConfigInterface
28
21
*/
@@ -52,22 +45,17 @@ class TemplatePlugin
52
45
* @param \Psr\Log\LoggerInterface $logger
53
46
* @param \Magento\Framework\View\ConfigInterface $viewConfig
54
47
* @param \Magento\Framework\Math\Random $mathRandom
55
- * @param \Magento\Framework\Escaper|null $escaper
56
48
* @param \Magento\Framework\Serialize\Serializer\Json|null $json
57
49
*/
58
50
public function __construct (
59
51
\Psr \Log \LoggerInterface $ logger ,
60
52
\Magento \Framework \View \ConfigInterface $ viewConfig ,
61
53
\Magento \Framework \Math \Random $ mathRandom ,
62
- \Magento \Framework \Escaper $ escaper = null ,
63
54
\Magento \Framework \Serialize \Serializer \Json $ json = null
64
55
) {
65
56
$ this ->logger = $ logger ;
66
57
$ this ->viewConfig = $ viewConfig ;
67
58
$ this ->mathRandom = $ mathRandom ;
68
- $ this ->escaper = $ escaper ?? \Magento \Framework \App \ObjectManager::getInstance ()->get (
69
- \Magento \Framework \Escaper::class
70
- );
71
59
$ this ->json = $ json ?? \Magento \Framework \App \ObjectManager::getInstance ()->get (
72
60
\Magento \Framework \Serialize \Serializer \Json::class
73
61
);
@@ -127,32 +115,6 @@ public function afterFilter(\Magento\Framework\Filter\Template $subject, string
127
115
return $ result ;
128
116
}
129
117
130
- /**
131
- * Determine if custom variable directive's return value needs to be escaped and do so if true
132
- *
133
- * @param \Magento\Framework\Filter\Template $subject
134
- * @param \Closure $proceed
135
- * @param string[] $construction
136
- * @return string
137
- */
138
- public function aroundCustomvarDirective (
139
- \Magento \Framework \Filter \Template $ subject ,
140
- \Closure $ proceed ,
141
- $ construction
142
- ) {
143
- // Determine the need to escape the return value of observed method.
144
- // Admin context requires store ID of 0; in that context return value should be escaped
145
- $ shouldEscape = $ subject ->getStoreId () !== null && (int ) $ subject ->getStoreId () === Store::DEFAULT_STORE_ID ;
146
-
147
- if (!$ shouldEscape ) {
148
- return $ proceed ($ construction );
149
- }
150
-
151
- $ result = $ proceed ($ construction );
152
-
153
- return $ this ->escaper ->escapeHtml ($ result );
154
- }
155
-
156
118
/**
157
119
* Create a DOM document from a given string
158
120
*
0 commit comments