File tree Expand file tree Collapse file tree 4 files changed +15
-7
lines changed
lib/internal/Magento/Framework Expand file tree Collapse file tree 4 files changed +15
-7
lines changed Original file line number Diff line number Diff line change @@ -514,6 +514,11 @@ protected function getParameters($value)
514
514
$ tokenizer ->setString ($ value );
515
515
$ params = $ tokenizer ->tokenize ();
516
516
foreach ($ params as $ key => $ value ) {
517
+ $ validKey = strtolower ($ key );
518
+ if (strcmp ($ key ,$ validKey )) {
519
+ $ params [$ validKey ] = $ value ;
520
+ unset($ params [$ key ]);
521
+ }
517
522
if ($ value !== null && substr ($ value , 0 , 1 ) === '$ ' ) {
518
523
$ params [$ key ] = $ this ->getVariable (substr ($ value , 1 ), null );
519
524
}
Original file line number Diff line number Diff line change @@ -41,6 +41,11 @@ abstract class AbstractBlock extends \Magento\Framework\DataObject implements Bl
41
41
*/
42
42
public const CACHE_KEY_PREFIX = 'BLOCK_ ' ;
43
43
44
+ /**
45
+ * Prefix for custom cache key of block
46
+ */
47
+ public const CUSTOM_CACHE_KEY_PREFIX = 'CUSTOM_BLOCK_ ' ;
48
+
44
49
/**
45
50
* @var \Magento\Framework\View\DesignInterface
46
51
*/
@@ -1042,7 +1047,7 @@ public function getCacheKeyInfo()
1042
1047
public function getCacheKey ()
1043
1048
{
1044
1049
if ($ this ->hasData ('cache_key ' )) {
1045
- return static ::CACHE_KEY_PREFIX . $ this ->getData ('cache_key ' );
1050
+ return static ::CUSTOM_CACHE_KEY_PREFIX . $ this ->getData ('cache_key ' );
1046
1051
}
1047
1052
1048
1053
/**
Original file line number Diff line number Diff line change @@ -184,6 +184,7 @@ private function renderSpecialAttributes(): string
184
184
);
185
185
}
186
186
}
187
- return $ this ->_escaper ->escapeJsQuote ($ html );
187
+
188
+ return $ html ;
188
189
}
189
190
}
Original file line number Diff line number Diff line change @@ -161,14 +161,11 @@ 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
-
167
164
$ html = $ this ->link ->toHtml ();
168
165
$ this ->assertEquals (
169
- $ escaper -> escapeJsQuote ( '<li><a href="http://site.com/link.html" id="idrandom" ></a></li> '
166
+ '<li><a href="http://site.com/link.html" id="idrandom" ></a></li> '
170
167
.'<style>#idrandom { display: block; }</style> '
171
- .'<script>document.querySelector( \'#idrandom \').onclick = function () { alert("clicked"); };</script> ' ) ,
168
+ .'<script>document.querySelector( \'#idrandom \').onclick = function () { alert("clicked"); };</script> ' ,
172
169
$ html
173
170
);
174
171
}
You can’t perform that action at this time.
0 commit comments