File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
lib/internal/Magento/Framework/View Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -184,7 +184,6 @@ private function renderSpecialAttributes(): string
184
184
);
185
185
}
186
186
}
187
-
188
- return $ html ;
187
+ return $ this ->_escaper ->escapeJsQuote ($ html );
189
188
}
190
189
}
Original file line number Diff line number Diff line change @@ -161,11 +161,14 @@ public function testLinkHtml(): void
161
161
$ this ->link ->setDataUsingMethod ('style ' , 'display: block; ' );
162
162
$ this ->link ->setDataUsingMethod ('onclick ' , 'alert("clicked"); ' );
163
163
164
+ /** @var Escaper $escaper */
165
+ $ escaper = $ this ->objectManager ->getObject (Escaper::class);
166
+
164
167
$ html = $ this ->link ->toHtml ();
165
168
$ this ->assertEquals (
166
- '<li><a href="http://site.com/link.html" id="idrandom" ></a></li> '
169
+ $ escaper -> escapeJsQuote ( '<li><a href="http://site.com/link.html" id="idrandom" ></a></li> '
167
170
.'<style>#idrandom { display: block; }</style> '
168
- .'<script>document.querySelector( \'#idrandom \').onclick = function () { alert("clicked"); };</script> ' ,
171
+ .'<script>document.querySelector( \'#idrandom \').onclick = function () { alert("clicked"); };</script> ' ) ,
169
172
$ html
170
173
);
171
174
}
You can’t perform that action at this time.
0 commit comments