File tree Expand file tree Collapse file tree 4 files changed +7
-19
lines changed
app/code/Magento/Email/Model/Template
lib/internal/Magento/Framework
Filter/Template/Tokenizer Expand file tree Collapse file tree 4 files changed +7
-19
lines changed Original file line number Diff line number Diff line change @@ -81,11 +81,6 @@ class Filter extends Template
81
81
*/
82
82
protected $ _modifiers = ['nl2br ' => '' ];
83
83
84
- /**
85
- * @var string
86
- */
87
- private const CACHE_KEY_PREFIX = "EMAIL_FILTER_ " ;
88
-
89
84
/**
90
85
* @var bool
91
86
*/
@@ -414,10 +409,6 @@ public function blockDirective($construction)
414
409
$ skipParams = ['class ' , 'id ' , 'output ' ];
415
410
$ blockParameters = $ this ->getParameters ($ construction [2 ]);
416
411
417
- if (isset ($ blockParameters ['cache_key ' ])) {
418
- $ blockParameters ['cache_key ' ] = self ::CACHE_KEY_PREFIX . $ blockParameters ['cache_key ' ];
419
- }
420
-
421
412
$ block = null ;
422
413
423
414
if (isset ($ blockParameters ['class ' ])) {
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ public function tokenize()
25
25
}
26
26
27
27
if ($ this ->char () !== '= ' ) {
28
- $ parameterName .= strtolower ( $ this ->char () );
28
+ $ parameterName .= $ this ->char ();
29
29
} else {
30
30
$ parameters [$ parameterName ] = $ this ->getValue ();
31
31
$ parameterName = '' ;
Original file line number Diff line number Diff line change 12
12
use Magento \Framework \Cache \LockGuardedCacheLoader ;
13
13
use Magento \Framework \Config \ConfigOptionsListConstants ;
14
14
use Magento \Framework \DataObject \IdentityInterface ;
15
+ use Magento \Framework \Exception \RuntimeException ;
15
16
16
17
/**
17
18
* Base class for all blocks.
@@ -1043,17 +1044,13 @@ public function getCacheKeyInfo()
1043
1044
* Get Key for caching block content
1044
1045
*
1045
1046
* @return string
1046
- * @throws \Magento\Framework\Exception\LocalizedException
1047
+ * @throws RuntimeException
1047
1048
*/
1048
1049
public function getCacheKey ()
1049
1050
{
1050
1051
if ($ this ->hasData ('cache_key ' )) {
1051
1052
if (preg_match ('/[^a-z0-9\-\_]/i ' , $ this ->getData ('cache_key ' ))) {
1052
- throw new \Magento \Framework \Exception \LocalizedException (
1053
- __ (
1054
- 'Please enter cache key with only alphanumeric or hash string. '
1055
- )
1056
- );
1053
+ throw new RuntimeException (__ ('Please enter cache key with only alphanumeric or hash string. ' ));
1057
1054
}
1058
1055
1059
1056
return static ::CUSTOM_CACHE_KEY_PREFIX . $ this ->getData ('cache_key ' );
Original file line number Diff line number Diff line change 15
15
use Magento \Framework \Config \View ;
16
16
use Magento \Framework \Escaper ;
17
17
use Magento \Framework \Event \ManagerInterface as EventManagerInterface ;
18
- use Magento \Framework \Exception \LocalizedException ;
18
+ use Magento \Framework \Exception \RuntimeException ;
19
19
use Magento \Framework \ObjectManagerInterface ;
20
20
use Magento \Framework \Session \SessionManagerInterface ;
21
21
use Magento \Framework \Session \SidResolverInterface ;
@@ -246,13 +246,13 @@ public function testGetCacheKey()
246
246
/**
247
247
* Test for invalid cacheKey name
248
248
* @return void
249
- * @throws LocalizedException
249
+ * @throws RuntimeException
250
250
*/
251
251
public function testGetCacheKeyFail (): void
252
252
{
253
253
$ cacheKey = "test&''Key " ;
254
254
$ this ->block ->setData ('cache_key ' , $ cacheKey );
255
- $ this ->expectException (LocalizedException ::class);
255
+ $ this ->expectException (RuntimeException ::class);
256
256
$ this ->expectExceptionMessage ((string )__ ('Please enter cache key with only alphanumeric or hash string. ' ));
257
257
$ this ->block ->getCacheKey ();
258
258
}
You can’t perform that action at this time.
0 commit comments