File tree Expand file tree Collapse file tree 1 file changed +24
-1
lines changed
app/code/Magento/Theme/Block/Html Expand file tree Collapse file tree 1 file changed +24
-1
lines changed Original file line number Diff line number Diff line change 6
6
7
7
namespace Magento \Theme \Block \Html ;
8
8
9
+ use Magento \Framework \Escaper ;
10
+
9
11
/**
10
12
* Html page header block
11
13
*
14
16
*/
15
17
class Header extends \Magento \Framework \View \Element \Template
16
18
{
19
+ /**
20
+ * @var Escaper
21
+ */
22
+ protected $ escaper ;
23
+
24
+ /**
25
+ * Constructor
26
+ *
27
+ * @param \Magento\Framework\View\Element\Template\Context $context
28
+ * @param Magento\Framework\Escaper $escaper
29
+ * @param array $data
30
+ */
31
+ public function __construct (
32
+ \Magento \Framework \View \Element \Template \Context $ context ,
33
+ \Magento \Framework \Escaper $ escaper ,
34
+ array $ data = []
35
+ ) {
36
+ $ this ->_escaper = $ escaper ;
37
+ parent ::__construct ($ context , $ data );
38
+ }
39
+
17
40
/**
18
41
* Current template name
19
42
*
@@ -34,7 +57,7 @@ public function getWelcome()
34
57
\Magento \Store \Model \ScopeInterface::SCOPE_STORE
35
58
);
36
59
}
37
- $ this ->_data ['welcome ' ] = addslashes ($ this ->_data ['welcome ' ]);
60
+ $ this ->_data ['welcome ' ] = $ this -> _escaper -> escapeQuote ($ this ->_data ['welcome ' ], $ addSlashes = true );
38
61
return __ ($ this ->_data ['welcome ' ]);
39
62
}
40
63
}
You can’t perform that action at this time.
0 commit comments