File tree Expand file tree Collapse file tree 3 files changed +12
-2
lines changed
app/code/Magento/Email/Model/Template
lib/internal/Magento/Framework/View Expand file tree Collapse file tree 3 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -78,6 +78,11 @@ class Filter extends Template
78
78
*/
79
79
protected $ _modifiers = ['nl2br ' => '' ];
80
80
81
+ /**
82
+ * @var string
83
+ */
84
+ private const CACHE_KEY_PREFIX = "EMAIL_FILTER_ " ;
85
+
81
86
/**
82
87
* @var bool
83
88
*/
@@ -404,6 +409,11 @@ public function blockDirective($construction)
404
409
{
405
410
$ skipParams = ['class ' , 'id ' , 'output ' ];
406
411
$ blockParameters = $ this ->getParameters ($ construction [2 ]);
412
+
413
+ if ($ blockParameters ['cache_key ' ]) {
414
+ $ blockParameters ['cache_key ' ] = self ::CACHE_KEY_PREFIX . $ blockParameters ['cache_key ' ];
415
+ }
416
+
407
417
$ block = null ;
408
418
409
419
if (isset ($ blockParameters ['class ' ])) {
Original file line number Diff line number Diff line change @@ -1052,7 +1052,7 @@ public function getCacheKey()
1052
1052
$ key [] = (string )$ this ->deploymentConfig ->get (ConfigOptionsListConstants::CONFIG_PATH_CRYPT_KEY );
1053
1053
1054
1054
$ key = implode ('| ' , $ key );
1055
- $ key = sha1 ( $ key ); // use hashing to hide potentially private data
1055
+ $ key = hash ( ' sha256 ' , $ key ); // use hashing to hide potentially private data
1056
1056
return static ::CACHE_KEY_PREFIX . $ key ;
1057
1057
}
1058
1058
Original file line number Diff line number Diff line change @@ -246,7 +246,7 @@ public function testGetCacheKeyByName()
246
246
$ nameInLayout = 'testBlock ' ;
247
247
$ this ->block ->setNameInLayout ($ nameInLayout );
248
248
$ encryptionKey = $ this ->deploymentConfig ->get (ConfigOptionsListConstants::CONFIG_PATH_CRYPT_KEY );
249
- $ cacheKey = sha1 ( $ nameInLayout . '| ' . $ encryptionKey );
249
+ $ cacheKey = hash ( ' sha256 ' , $ nameInLayout . '| ' . $ encryptionKey );
250
250
$ this ->assertEquals (AbstractBlock::CACHE_KEY_PREFIX . $ cacheKey , $ this ->block ->getCacheKey ());
251
251
}
252
252
You can’t perform that action at this time.
0 commit comments