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
184184 );
185185 }
186186 }
187-
188- return $ html ;
187+ return $ this ->_escaper ->escapeJsQuote ($ html );
189188 }
190189}
Original file line number Diff line number Diff line change @@ -161,11 +161,14 @@ public function testLinkHtml(): void
161161 $ this ->link ->setDataUsingMethod ('style ' , 'display: block; ' );
162162 $ this ->link ->setDataUsingMethod ('onclick ' , 'alert("clicked"); ' );
163163
164+ /** @var Escaper $escaper */
165+ $ escaper = $ this ->objectManager ->getObject (Escaper::class);
166+
164167 $ html = $ this ->link ->toHtml ();
165168 $ 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> '
167170 .'<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> ' ) ,
169172 $ html
170173 );
171174 }
You can’t perform that action at this time.
0 commit comments